Let’s say you have a random number generator RNG3() that uniformly returns from and you must use it to build RNG7() that uniformly returns from . How might you do it?
Here’s another problem from the Algorithm Design Manual (Skiena), Interview Problem 4-44:
Design a stack that supports push, pop, and retrieving the minimum element in constant time. Can you do this?
Here’s a nice problem from Notes on Streaming Algorithms:
Suppose we have sequence from a set , and that we know that one value from occurs more than times in the sequence; find the most frequent value using only two variables having total memory of only bits and in only a single sweep.