hw3 - k ≥ 1, design an O ( k log k ) time algorithm to...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 413, Analysis of Algorithms Fall Semester, 2004 Assignment 3: Data Structures Due Date : Sept. 27, 2004 (at the beginning of CSE 413 class) Note : The problems in this assignment are quite difficult! Please start working on them as early as possible, and ask questions if clariFcations or further explanations are needed. The techniques discussed in class on adding and maintaining additional information in data structures are essential for the solutions of problems 2, 3, and 4. 1. Given a min-heap H of n keys stored in an array and an integer
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: k ≥ 1, design an O ( k log k ) time algorithm to Fnd the k-th smallest key in H . Note that k can be much smaller than n , and thus you cannot assume that log k = Θ(log n ) in general. ( 20 points ) Hint : Your algorithm may make use of a heap data structure, say H . What would your heap H contain and how would your algorithm make use of it? 2. Exercise 4.16, page 88. ( 20 points ) 3. Exercise 4.26, page 89. ( 20 points ) 4. Exercise 4.28, page 89. ( 20 points ) Total Points : 80...
View Full Document

This note was uploaded on 01/06/2012 for the course MANAGEMENT 000 taught by Professor 游啟璋 during the Spring '11 term at National Taiwan University.

Ask a homework question - tutors are online