蓄水池算法 知乎实习笔试

因为知乎笔试接触到这个问题,po上来。问题起源于编程珠玑Column 12中的题目10,其描述如下: How could you select one of n objects at random, where you see the objects sequentially but you do not know the value of n beforehand? For concretene

点赞