hw5 - multiple selection problem is that of ±nding the k...

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 5 Due Date : Nov. 1, 2004 (at the beginning of CSE 413 class) 1. Problem 6.37, page 179. For this problem, the time complexity is not our concern (i.e., your algorithm may take as much time as you want). But, the space bound is our target. Also, we assume that the sequence of input numbers x 1 ,x 2 ,...,x n is given only once to your algorithm. ( 20 points ) 2. Let S be a set of n real numbers a 1 , a 2 , ..., a n , not in a sorted order. Given m integers k 1 , k 2 , ..., k m ,w ith1 k 1 <k 2 < ··· <k m n
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: multiple selection problem is that of ±nding the k i-th smallest element in the set S for every i = 1, 2, . . . , m . A person solved this problem by applying m times the Selection algorithm that was discussed in class, one for each integer k i . This resulted in an O ( mn ) time algorithm. You are asked to design an O ( n log m ) time algorithm for this problem. ( 20 points ) 3. Problem 5.16, page 115. ( 20 points ) 4. Problem 5.19, page 115. ( 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