Question Detail: As I understand it when doing a DFS run when every new node is discovered and edge is added to the DFS tree from the parent of the new node to the new node. If that’s the case how Read More …
Author: ignougroup
Proof that a randomly built binary search tree has logarithmic height
Question Detail: How do you prove that the expected height of a randomly built binary search tree with $n$ nodes is $O(log n)$? There is a proof in CLRS Introduction to Algorithms (chapter 12.4), but I don’t understand it. Asked By Read More …
Why would anyone want CISC?
Question Detail: In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a RISC design, that is its elementary Read More …
Language theoretic comparison of LL and LR grammars
Question Detail: People often say that LR(k) parsers are more powerful than LL(k) parsers. These statements are vague most of the time; in particular, should we compare the classes for a fixed $k$ or the union over all $k$? So how Read More …
How to map the tapes of a “k-tape” Turing Machine into the single tape of a “1-tape” Turing Machine
Question Detail: I’m reading Sipser and I’m finding it hard to understand what the process is such that if you give me k Turing machines with k tapes, I can spit out an equivalent Turing machine with only one tape. An Read More …
How hard is counting the number of simple paths between two nodes in a directed graph?
Question Detail: There is an easy polynomial algorithm to decide whether there is a path between two nodes in a directed graph (just do a routine graph traversal with, say, depth-first-search). However it seems that, surprisingly, the problem gets much harder Read More …
Generalised 3SUM (k-SUM) problem?
Question Detail: The 3SUM problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$. It is conjectured that there is not better solution than quadratic, i.e. $mathcal{o}(n^2)$. Or Read More …
Visual Programming languages
Question Detail: Most of us learned programming using “textual” programming languages like Basic, C/C++, and Java. I believe it is more natural and efficient for humans to think visually. Visual programming allows developers to write programs by manipulating graphical elements. I Read More …
Converting an NFA to regex using GNFA algorithm?
Question Detail: So I’ve been trying to crack this for a long time and almost feel like I am going in loops about this question. Given the following NFA: Using the GNFA algorithm get the regular expression. I understand that you Read More …
When would best first search be worse than breadth first search?
Question Detail: I am studying best first search as it compares to BFS (breadth-first search) and DFS (depth-first search), but I don’t know when BFS is better than best-first search. So, my question is When would best-first search be worse than Read More …