新鲜G面筋(2)# JobHunting - 待字闺中
r*d
1 楼
given random generator rand(int n)
now, design a random generator such as
rand(int n, int[] except)
example, n=10, random 1-10
now, except[3]={1,5,6}
then rand(10, except) output {2,3,4, 7, 8, 9,10}
提到hashtable, 对方说,如果n很大,百万,output 几个数,怎么办?
now, design a random generator such as
rand(int n, int[] except)
example, n=10, random 1-10
now, except[3]={1,5,6}
then rand(10, except) output {2,3,4, 7, 8, 9,10}
提到hashtable, 对方说,如果n很大,百万,output 几个数,怎么办?