Lecture 28

Learning objectives

After this class, you should be able to:

  1. Define a heap.
  2. Given a sequence of insertions into a 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.
  6. Determine the children and parent of a node, given its index in its array representation.
  7. Give applications of heaps.
  8. Explain why data structures that we have studied earlier are not ideal for implementing a priority queue.

Reading assignment

  1. Section 6, up to section 6.3.3.
  2. Lecture: Priority queues.

Exercises and review questions


Last modified: 4 Nov 2013