Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Comment
by
gelisam
· 12y ago · 0 comments
How about adding new elements with lower keys instead of decreasing the existing elements? Then, once we count that more than half of the n elements are duplicates, we could spend O(n log n) operations cleaning up the heap by recreating it.
Comments
No comments yet.
Better HN