Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- MaxPQ: insert, delMax, isEmpty.
Exam weight Low
Exam weight
High
- Unordered array: insert O(1), delMax O(N). Ordered array: insert O(N), delMax O(1). Binary heap: both O(log N).
🎯 How this can come up · 1 question
MCQ
With a binary heap, insert and delete-max are:
Correct: O(log N) each.
Exam weight Low
Exam weight Low
- Complete binary tree: perfectly balanced except the bottom level, filled left to right; height ⌊lg N⌋.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- Heap-ordered: every parent ≥ its children (max-heap). Array: parent of k is k/2; children 2k, 2k + 1.
🎯 How this can come up · 1 question
MCQ
In a 1-based heap array, the parent of the node at index 9 is at:
Correct: 4.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Insert: add at the end, swim up while larger than parent.
Exam weight Low
Exam weight Low
- Delete max: swap root with the last item, remove it, sink the new root.
Exam weight Low
Exam weight Low
No slides match this filter.