|
-
August 22nd, 2010, 02:54 PM
#1
Why heaps exist when we have trees
Any ideas about a serious advantage of a heap over a balanced BST?
I see that heap can be implemented in an array, and the code is simpler. Fine, that's something. When only heap is needed, it'll be somewhat more efficient, but not asimptoticaly.
Does anybody see any qualitive advantage of heaps over balanced BSTs?
(If we cache the maximum in a BST we have the same O(1) getMax operation. )
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|