Heaps Flashcards
1
Q
Max heap
A
The root must be the maximum among all of its children
2
Q
Min heap
A
The root must be the minimum among all of its children.
3
Q
Heaps: inserting
A
- Insert key X at the bottom of the heap
- Heapify
4
Q
Heaps: deletion
A
- Remove key from root
- Replace with the last key of the heap
- Heapify
5
Q
Heapify Code
A
6
Q
Heapsort code
A