This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: IE170 Lab #4 Mustafa R. Kılın¸ c & Jeff Linderoth IE 170 – Lab #4: Heaps and Heapsort Due Date: February 12, 2006. 11AM. 1 Description and Objectives In this lab, we will implement a clever partially ordered data structure called a heap , and use a heap to implement the heapsort algorithm, and we will see if we can beat the Java Collections class for sorting speed. For extra credit, we will compare the heapsort algorithm with the insertion sort algorithm that you already implemented during last two labs. Thus, if your insertion sort doesn’t work, you may want to try and fix it. Lab Objectives 1. Understand heaps and the heap property. 2. Understand how to implement heaps and the heapsort algorithm. 3. Understand the effect of data structures on sorting algorithm’s complexity. 4. Compare heapsort with to Java Collections sorting. 5. Learn how to read data from a file. 2 Heaps and Heapsort A max-heap can be defined as a binary tree with keys assigned to its node satifying following...
View Full Document
- Spring '07
- Systems Engineering, Jeff Linderoth, Mustafa R. Kilin¸