Need explanation on "K frequent numbers"
Anonymous User
85

Hi
Can anyone explain following code:
``// initialise a heap with most frequent elements at the top
auto comp = [&count_map](int n1, int n2) { return count_map[n1] > count_map[n2]; };
priority_queue<int, vector, decltype(comp)> heap(comp);

Comments (1)