Problem Detail: I had written a compiler compiler a few years ago and I’m now cleaning it up, improving it, and turning it into C. I came across a terminology problem however that I remember in the past I couldn’t solve Read More …
Blog
[Solved]: Trouble understanding how to pick constants to prove big theta
Problem Detail: So I’m reading Introductions to Algorithms and sometimes I wish it would be a little bit more friendly with how it explains topics. One of these topics is proving big-theta. I understand that the definition of $Theta$ is as Read More …
[Solved]: prove that minimal number of comparisons to find median among five elements is 5
Problem Detail: I would like to prove that we need at least five comparisons to find median amoung five numbers. And my proposition: Let’s consider tree of comparisons. There are at least $5 cdot {4choose 2} = 30$ possiblities, so in Read More …
[Solved]: Finding the longest common subsequence algorithm using hash table Slow
Problem Detail: I’ve designed an algorithm to find the longest common subsequence. these are steps: Starts with i = 0 Picks the first letter from the first string start from ith letter. Go to the second string looking for that picked Read More …
[Solved]: Determining capabilities of a min-heap (or other exotic) state machines
Problem Detail: See the end of this post for some clarification on the definition(s) of min-heap automata. One can imagine using a variety of data structures for storing information for use by state machines. For instance, push-down automata store information in Read More …
[Solved]: Why is the base used to compute hashes in Rabin–Karp always primes?
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 …
[Solved]: Meaning of complexity of a computational problem
Problem Detail: If I understand correctly, the complexity of solving a computational problem is defined in terms of which instance $I$ of the problem, what size $n$ of the problem instance, and what algorithm $A$ for solving the problem instance. Is Read More …
[Solved]: Count of all simple paths between two vertices in a Complete graph
Problem Detail: A path is simple if it repeats no vertices. How many simple paths between two vertices in Complete graph? One way is listing the simple paths is to use depth-first search. but i think it should be simple to Read More …
[Solved]: Why is there no two-bit data type?
Problem Detail: Why do most programming languages (if not all) lack a 2-bit data type? A boolean is a single bit with the values being either true or false. Why is there no native, corresponding type where the values can be Read More …
[Solved]: Automatic seat assignment algorithm
Problem Detail: I am looking for articles relating to algorithms that deal with automatic selection of seating assignment. I need an algorithm (preferably more than one) that can automatically select a seating place while enforcing certain constraints that are predefined. Originally Read More …