LeetCode 398: Random Pick Index
A clear explanation of picking a uniformly random index for a target value using reservoir sampling, with an alternative hash map approach.
2 notes
A clear explanation of picking a uniformly random index for a target value using reservoir sampling, with an alternative hash map approach.
A clear explanation of selecting a random linked list node with equal probability using reservoir sampling.