Lecture 22

Learning objectives

After this class, you should be able to:

  1. Define a heap.
  2. Given a sequence of insertions and DeleteMax or DeleteMin in a max or min heap, draw the resulting heap.
  3. Given a heap drawn as a tree, show its array representation.
  4. Given the array representation of a heap, draw it as a tree.
  5. Give the time complexity for insertion into a heap, and DeleteMax/Min on it.
  6. Determine the children and parent of a node, given its index in its array representation.
  7. Give applications of heaps.

Reading assignment

  1. Section 6.9, except sec 6.9.2.

Exercises and review questions


Last modified: 27 Mar 2008