Hard Problems on Randomized Algorithms
- Generate integer from 1 to 7 with equal probability
- Implement random-0-6-Generator using the given random-0-1-Generator
- Select a random number from stream, with O(1) space
- Random number generator in arbitrary probability distribution fashion
- Reservoir Sampling
- Linearity of Expectation
- Introduction and implementation of Karger’s algorithm for Minimum Cut
- Select a Random Node from a Singly Linked List
- Select a Random Node from a tree with equal probability
- Freivald’s Algorithm to check if a matrix is product of two
- Random Acyclic Maze Generator with given Entry and Exit point
Recommended:
Randomized Algorithms
Randomized algorithms in data structures and algorithms (DSA) are algorithms that use randomness in their computations to achieve a desired outcome. These algorithms introduce randomness to improve efficiency or simplify the algorithm design. By incorporating random choices into their processes, randomized algorithms can often provide faster solutions or better approximations compared to deterministic algorithms. They are particularly useful in situations where exact solutions are difficult to find or when a probabilistic approach is acceptable.
For example, in Randomized Quick Sort, we use a random number to pick the next pivot (or we randomly shuffle the array). Typically, this randomness is used to reduce time complexity or space complexity in other standard algorithms.
Contact Us