hwk8 - n distinct numbers and a positive integer k...

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

View Full Document Right Arrow Icon
Fall 2010 CMSC 351: Homework 8 Clyde Kruskal Due at the start of class Thursday, December 2, 2010. Problem 1. In class we analyzed the average case of selection under the conservative assumption that the element being selected is always on the larger side after partition. Analyze the average case of selection under the liberal assumption that element being selected is always on the smaller side after partition? Get the high order term exactly. Problem 2. Give an O ( n )-time algorithm that, given a set S of
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n distinct numbers and a positive integer k , determines the k numbers in S that are closest to the median of S . Problem 3. Assume you have an undirected graph, with n vertices and m edges, stored in the adjacency list representation. Then each undirected edge ( x,y ) is stored twice (once on x ’s list of edges and once on y ’s list of edges). Give an e±cient algorithm to make the two occurences of each edge point to each other (assuming initially they do not)....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online