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

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

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 n distinct numbers and a positive
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 ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern