News for hackers. Stuff that matters.
Re:Data structures and algorithms problems in C++ using STL by anilshanbhag on Friday March 10, 2017 @08:55AM (#13838553)
Just looked at the kth largest algorithm and author claims max heap method is k log n ! His method is actually n log n. The min heap is n log k and the right way to do it.
Re:Data structures and algorithms problems in C++ using STL by coder007 on Friday March 10, 2017 @03:08PM (#13841665)
it is clearly O(klogn). We are popping k times from a heap of size n.