Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
anilshanbhag
· 9y ago · 0 comments
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.
Comments
[–]
coder007
9y ago
it is clearly O(klogn). We are popping k times from a heap of size n.