Learning Outcomes
At the end of this lecture, you’ll be able to:
- Describe what Priority Queue is and how it is different from standard Queue.
- Describe how “natural ordering” of objects is established in Java.
- Explain the difference between
Comparable
andComparator
interfaces. - Describe the core operations of Priority Queue.
- Enumerate the structure and order properties of binary heap.
- Differentiate binary search trees from binary heaps.
- Explain and trace the core operations of Priority Queue with Binary Heap implementation.
- Understand the operations of Priority Queue with Binary Heap well enough to implement it.
- Contrast efficiency of alternative implementation approaches (e.g. sorted/unsorted sequence vs binary heap).
- Explain how a binary heap can be represented using a (ranked) array.
Lecture Plan
In this lecture, we'll cover the following lessons:
- PriorityQueue ADT
- Submission class
- Sorting submissions
- Prioritizing Submissions
- Java's Comparator
- PriorityQueue Interface
- PriorityQueue: Implementation⚡
- PriorityQueue: Tree Implementation
- Heap: Structure Property⚡
- Heap: Order Property⚡
- Heap: Ranked Array Representation
- Heap: Best
- Heap: Insert
- Heap: Remove
- Heap Operations: Exercise⚡
Lessons marked with ⚡ contain exercise/activity.