## Self-Review Questions

- What is the worst-case runtime complexity of finding the smallest item in a min-heap?
- What is the worst-case runtime complexity of finding the largest item in a min-heap?
- What is the worst-case runtime complexity of deleteMin in a min-heap?
- What is the worst-case runtime complexity of building a heap by insertion?
- Is a heap full or complete binary tree? :
- What is the worst-time runtime complexity of sorting an array of N elements using heapsort?
- Given a sequence of numbers:
`1, 2, 3, 4, 5`

- Draw a binary MIN-heap (in a TREE form) by inserting the above numbers reading them from left to right
- Show a tree that would be the result after the call to deleteMin() on this heap

- Given a sequence of numbers:
`1, 2, 3, 4, 5`

- Draw a binary MAX-heap (in a TREE form) by inserting the above numbers reading them from left to right
- Show a TREE that would be the result after the call to deleteMax() on this heap

- Given a sequence of numbers:
`3, 5, 2, 8, 1, 5, 2`

- Draw a binary MIN-heap (in an ARRAY form) by inserting the above numbers reading them from left to right
- Show an ARRAY that would be the result after the call to deleteMin() on this heap

Victor S.Adamchik, CMU, 2009