1. high efficiency algorithm
2. divide the timers based on their expirations
3. always handling the timers in the first L2 queue
4. when one of the L2 queue is empty, move the coming timers from it’s next one
5. algorithm analysis: add and delete 1 timer: O(1), search 1 timer: O(avg(L2queue’s length))
阅读(450) | 评论(0) | 转发(0) |