Generate a subset in a uniformly random manner
21 Feb
Question: To generate a K-subset in a uniformly random manner from N elements. We have two slightly different solutions. The first one is quite straightforward: shuffle the elements, and then return the first K elements. In such solution, the space … Read More »