Problem Detail: The Count-Min Sketch is an awesome data structure for estimating the frequencies of different elements in a data stream. Intuitively, it works by picking a variety of hash functions, hashing each element with those hash functions, and incrementing the Read More …
Category: Uncategorized
[Solved]: Kruskal’s and Prim’s algorithm
Problem Detail: Does Kruskal’s and Prim’s algorithm work on directed graphs? I want the two algorithms to find a minimum spanning tree. For further enlightenment, I would like to know what other problems Kruskal’s and Prim’s can solve. So far, I Read More …
[Solved]: Depth of any node x in Weighted Quick-Union Algorithm
Problem Detail: I know from Sedgewick’s book on algorithms that the max depth of any node x from a set of N nodes is at most log2(N) applying the algorithm(which says to put the shorter tree beneath to avoid tall trees) Read More …
[Solved]: DFA for a strings whose every subsequence of length five has at least two zeroes
Problem Detail: I have a regular language consisting of such {0,1}^k sequences, in which every subsequence of length 5 has at least two 0’s in it (which also means every sequence of length <5 is ‘good’). I need to find a Read More …
[Solved]: Converting final state PDA to empty stack PDA
Problem Detail: I’m having a problem understanding this conversion. Let’s say we have a CFL like this: $ { a^nb^m : n > m } $ A final state acceptance PDA for this language would push $A$ symbols in the stack Read More …
[Solved]: What is the difference between operator and function?
Problem Detail: We have operator and operands, function and formal arguments. Is the difference purely lexical (we use alphanumerics for funciton identifiers but identify operators with special characters, e.g. “+” and “>=”) or it is syntactical, like I guessed here f(a,b) Read More …
[Solved]: Is the intersection of two context free languages recursively enumerable?
Problem Detail: I read a quotation attributed to Sheila Greibach that says that the intersection of two context free grammars is recursively enumerable. I could not, however, find a citation for this quotation (and searching has failed to turn up a Read More …
[Solved]: Rice’s theorem for non-semantic properties
Problem Detail: Rice’s theorem tell us that the only semantic properties of Turing Machines (i.e. the properties of the function computed by the machine) that we can decide are the two trivial properties (i.e. always true and always false). But there Read More …
[Solved]: Difference between CRC and Hamming Code
Problem Detail: I am a bit confused on the difference between Cyclic Redundancy Check and Hamming Code. Both add a check value attached based on the some arithmetic operation of the bits in the message being transmitted. For Hamming, it can Read More …
[Solved]: Points-in-a-plane from HackerRank
Problem Detail: I’ve been struggling with this problem for days now, making no progress: There are N points on an XY plane. In one turn, you can select a set of collinear points on the plane and remove them. Your goal Read More …