Priority Queue
After reading this chapter and engaging in the embedded activities and reflections, you should be able to:
- Describe what Priority Queue is and how it is different from standard Queue.
- Describe the core operations of Priority Queue.
- Contrast the efficiency of alternative implementation approaches (e.g., sorted/unsorted sequence vs. binary heap).
- Enumerate the structure and order properties of a binary heap.
- Differentiate binary search trees from binary heaps.
- Explain how a binary heap can be represented using a (ranked) array.
- Explain and trace the core operations of Priority Queue with Binary Heap implementation.
- Understand the operations of Binary Heap well enough to implement it.
- Explain the role of the overloaded non-default constructor of PriorityQueue.
- Describe how the "natural ordering" of objects is established in Java.
- Explain the difference between
Comparable
andComparator
interfaces.
Starter code for this chapter
Solution code
Solution code for this chapter.