Problem Detail: The Rabin–Karp string matching algorithm requires a hash function which can be computed quickly. A common choice is $$ h(x_0ldots x_n) = sum_{i=0}^n b^i x_i, $$ where $b$ is prime (all computations are module $2^w$, where $w$ is the Read More …
Category: Uncategorized
[Solved]: What is the advantage of Day-Stout-Warren algorithm for balancing BST?
Problem Detail: While reading about Day–Stout–Warren algorithm for balancing BST which takes any BST and transforms it into a balanced BST in O(n) time. In my opinion I can achieve absolutely the same with these simple steps: convert BST into array Read More …
[Solved]: All soldiers should shoot at the same time
Problem Detail: When I was a student, I saw a problem in a digital systems/logic design textbook, about N soldiers standing in a row, and want to shoot at the same time. A more difficult version of the problem was that Read More …
[Solved]: Linear programming with absolute values
Problem Detail: I know that sometimes we can use absolute values into the objective functions or constraints. Is it always possible to use them, anywhere ? Example of use of absolute values: Minimize |a+b+c| + |a-c| s.t. |a| + b > Read More …
[Solved]: Dijkstra’s algorithm on huge graphs
Problem Detail: I am very familiar with Dijkstra and I have a specific question about the algorithm. If I have a huge graph, for example 3.5 billion nodes (all OpenStreetMap data) then I clearly wouldn’t be able to have the graph Read More …
[Solved]: Difference between algorithm and procedure
Problem Detail: I came to know that the important difference between algorithm and procedure is that the algorithm halts and procedure doesn’t halts(stops). But i am not able to understand the concept. Please can any one explain with the example? Asked Read More …
[Solved]: Are expert systems outdated, what are better alternatives to them, if any?
Problem Detail: I need to link facts to actions through rules. If a person bought soup 10 times and he is coming at midday every day, then the system should link the fact that the person bought soup so many times, Read More …
[Solved]: What piece am I missing to turn this idea into a programming language?
Problem Detail: I’ve been doing some reading (I’ll name drop along the way) and have selected a few scattered ideas that I think could be cobbled together into a nifty esoteric programming language. But I’m having some difficulty assembling the parts. Read More …
[Solved]: Show that regular languages are closed under Mix operations
Problem Detail: Let $L_1, L_2$, two regular languages and the operations: $$Mix_1(L_1, L_2) ={ a_1b_1a_2b_2ldots a_nb_n | nge 0 land a_1,a_2,ldots ,a_n,b_1,b_2,ldots ,b_ninSigma land a_1a_2ldots a_nin L_1 , b_1b_2ldots b_nin L_2}$$ $$Mix_2(L_1, L_2) = { x_1y_1x_2y_2ldots x_ny_n | nge 0 land Read More …
[Solved]: Reduce Clique to Vertex Cover
Problem Detail: I read on the internet that it’s possible to reduce Clique to Vertex Cover. Almost everyone use this theorem: if a graph $G$ has a clique of size $k$ then the complement of $G$ has a vertex cover of Read More …