今際の国の呵呵君
Sunday, October 22, 2017
[LeetCode]Random Pick Index
不让我们用太多空间,我们用时间换空间即可。O(N)时间用
Reservoir Sampling
生成随机数,常数空间,代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment