assign2 - Assignment 2: Heap Sort (Due: Monday, October...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 2: Heap Sort (Due: Monday, October 27th 2008, 11:59pm) Forbes list of 50 richest people in the world for year 2007 was recently released. The attached forbes50.list is a copy of that list with the first name, last name and net worth in billions. Part A: Implement heap sort and use it to rewrite the list in ascending order. Use the persons’ first name as the key. Sample Input: 4 John Doe 50 Peter Han 44 Pete Willis 35 Jane Doe 24 Sample Output: 4 Jane Doe 24 John Doe 50 Pete Willis 35 Peter Han 44 Refer to chapter 6 of the textbook for additional information. Part B: i) State the complexity of YOUR algorithm using big-Oh notation. Complexity will be based upon the loops and various statements executed by your algorithm to perform sorting. ii) What is the complexity of the heap construction step alone, in big-Oh notation for your algorithm? iii) What is the complexity of the selection step, in big-Oh notation for your algorithm? Implementation Aspects
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

assign2 - Assignment 2: Heap Sort (Due: Monday, October...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online