- A min-max heap is a complete binary tree and often represented in an array.
- Invariants:
- containing alternating min and max levels
- the root is always at min level
- every node at min level is less than all of its descendants
- every node at max level is greater than all of its descendants
- Basic operations:
- insert an element
- find the least/greatest element
- delete the least/greatest element
- Time complexity:
- Insert & deletion: O(lg n)
- getMin & getMax: O(1)
-
Notifications
You must be signed in to change notification settings - Fork 2
frankpeng7/Min-Max-Heap
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published