面试题:GetNumber and ReleaseNumber# JobHunting - 待字闺中
c*e
1 楼
The best data structure in terms of big O?
At the begging, the system has a pool of positive integers,
1. int GetNumber(): return the smallest available number in the pool
2. ReleaseNum(int i): release that the number back into the pool.
What is the good data structure for the pool, describe the big O.
At the begging, the system has a pool of positive integers,
1. int GetNumber(): return the smallest available number in the pool
2. ReleaseNum(int i): release that the number back into the pool.
What is the good data structure for the pool, describe the big O.