This preview shows page 1. Sign up to view the full content.
Unformatted text preview:  (10 pts.) Exercise 6.4-3, page 136.  (10 pts.) Exercise 6.5-7, page 142  (10 pts.) Imagine that instead of using an array to represent the heap, we use a singly linked list. Why might this be innefficient? (Hint: Consider the insertions that must be done). (10 pts.) Given a set S of n numbers, we want to construct an algorithm that outputs t h e k smallest members of S in sorted order. (a) Describe an algorithm that uses ) lg ( n n O time and ) ( n O space. (b) Describe an algorithm that uses a heap and solves the problem in ) lg ( n k n O + time and ) ( n O space....
View Full Document
This note was uploaded on 01/01/2011 for the course COMS 311 taught by Professor Professor during the Fall '08 term at Iowa State.
- Fall '08