Problem Detail: I am referring to the algorithm from the Wikipedia page on the Floyd–Warshall algorithm. In case of undirected graphs should I change the assignment statement inside the if condition to dist[i][j] = dist[j][i] = dist[i][k] + dist[k][j] or they Read More …
Author: ignougroup
Pushdown automaton for complement of { ww | … }
Problem Detail: I want to be able to describe the idea behind the pushdown automaton (no tables or diagrams). So, I already know that $L = { ww mid w text{ in } (0,1)^*}$ is not context free. Since CFL are Read More …
What is the best solution to find whether the sum of an array is even or odd
Problem Detail: I was asked this question in an interview. I was not able to find a better solution than $O(n)$ which is just going over the array and finding the sum. Can it be done any better? I am not Read More …
When should I learn artificial intelligence?
Problem Detail: Straight to the point: I would really like to learn AI. But I want some advice from experienced CS guys as to when I should jump into Artificial Intelligence. What prerequisites are needed in order for me to better Read More …
Logarithmic vs double logarithmic time complexity
Problem Detail: In real world applications is there a concrete benefit when using $mathcal{O}(log(log(n))$ instead of $mathcal{O}(log(n))$ algorithms ? This is the case when one use for instance van Emde Boas trees instead of more conventional binary search tree implementations. But Read More …
AVL trees are not weight-balanced?
Problem Detail: In a previous question there was a definition of weight balanced trees and a question regarding red-black trees. This question is to ask the same question, but for AVL trees. The question is, given the definition of $mu$-balanced trees Read More …
Why does bubble sort do $Theta(n^2)$ comparisons on an $n$ element list?
Problem Detail: I have a quick question on the bubble sort algorithm. Why does it perform $Theta(n^2)$ comparisons on an $n$ element list? I looked at the Wikipedia page and it does not seem to tell me. I know that because Read More …
Maximum sub-matrix sum
Problem Detail: Given a $ntimes m$ matrix $A$ of integers, find a sub-matrix whose sum is maximal. If there is one row only or one column only, then this is equivalent to finding a maximum sub-array. The 1D version can be Read More …
Is there any uncountable Turing decidable language?
Problem Detail: There are many(and I mean many) countable languages which are Turing-decidable. Can any uncountable language be Turing decidable? Asked By : Jyotirmoy Pramanik Answered By : Yuval Filmus Every language over a finite (or even countable) alphabet is countable. Assuming your Read More …
How to stop genetic algorithm population converging to a single value
Problem Detail: I’ve written a genetic algorithm (GA) that solves a 7-dimensional optimisation problem. All seven variables are floating point numbers. The problem is that the entire population seems to converge to very nearly the same point in the solution space Read More …