Skip to content
Heaps and Priority Queues
Computing · JC 2 · Abstract Data Structures and Algorithms · Semester 1

Heaps and Priority Queues

Students will learn to create and use simple functions to group related instructions, making programs more organized and easier to manage.

MOE Syllabus OutcomesMOE: Programming - Middle School

About This Topic

Students will learn to create and use simple functions to group related instructions, making programs more organized and easier to manage.

Key Questions

  1. Prove that the build-heap procedure runs in O(n) time rather than O(n log n) using an amortised argument over the levels of the heap.
  2. Trace the sift-up and sift-down operations on a max-heap during insertion and extract-max, and derive the O(log n) complexity of each operation.
  3. Design an application requiring a priority queue,such as a task scheduler or Dijkstra's algorithm,and justify why a binary heap is the appropriate underlying structure compared to a sorted list.

Active Learning Ideas

See all activities

Activities & Teaching Strategies

See all activities

Edited by Adriana Perusin, Editor-in-Chief, Flip Education
Synthesized by Flip Education from Lyman's Think-Pair-Share collaborative-discussion routine (1981)