发表于 2016-10-14 15:34:47
标 题: Re: 请教一道面试题
Thanks a lot! If the input is a vector of all events, could I just use a
totalTime and id pair to record the max value for this problem?
If it is a dynamic updating, which uses this function to update the result
with real time events continuously, is it necessary to use another MaxHeap
of activated ids sort by Node.totalTime - Node.lastLogin?
【 在 coldknight (冷骑士) 的大作中提到: 】
: HashTable<Id, Node>
: MaxHeap<Node> sort by Node.totalTime