Table of Contents
Data Structures and Problem Solving Using Java by Mark A. Weiss: chapter 18 on Priority Queues and Binary Heaps
Data Structures and Algorithms in Java by Michael T. Goodrich and Roberto Tamassia (4th edition): section 6.3 on Heaps
Review the contents of the class and read the recommended bibliography.
Implement the insertion algortithm for binary search trees.
Given two Binary Search Trees, tree1 and tree2, each of which is built inserting, with the previously implemented method, 10,000 Integer objects with values ranging from 1 to 10,000:
tree1: calling the insertion method with the values in increasing order
tree2: calling the insertion method with the values in random order
In general, which of the two trees will be more efficient for searching any given element?
Implement the deletion algorithm for a binary heap.
Let's set a priority queue implemented with a heap, using the priority as the criterion for ordering the elements. Can it be ensured that two elements with equal priority will be recovered in the same order as they entered the priority queue (as they should be)? If not, how could it be fixed?
Read the exercises proposed for the lab session.
Binary Heap Applet by Kubo Kovac. It also shows interactive animations of other tree-based data structures, like Binary Search Trees.