Medium Problems on Randomized Algorithms
- Make a fair coin from a biased coin
- Shuffle a given array using FisherâYates shuffle Algorithm
- Expected Number of Trials until Success
- Strong Password Suggester Program
- QuickSort using Random Pivoting
- Operations on Sparse Matrices
- Estimating the value of Pi using Monte Carlo
- Implement rand12() using rand6() in one line
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