# HW2 - Computer Science 830: Design and Theory of Algorithms...

This preview shows pages 1–2. Sign up to view the full content.

Computer Science 830: Design and Theory of Algorithms Homework #2 Due Feb. 4 th 2008, 3pm Each problem should be solved on a separate sheet of paper to facilitate grading. Limit the solution of each problem to one side of a sheet of paper. Please don't wait until the last minute to look at the problems. 1. Use the partitioning step of quicksort to give an algorithm that finds the median element of an unsorted array of n integers in expected O(n) time. 2. Outline a reasonable method of solving each of the following problems. Give a tight bound on the worst-case complexity of your methods. You may describe your algorithm in a common programming language, in pseudocode, or in English, but please be sure to be thorough. a. You are given an unsorted list of m stocks that you are investing in, and a sorted list of all n stocks available, saying if they have gone up or down today. Determine how many of your stocks have dropped. b.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/25/2008 for the course CSE 830 taught by Professor Ofria during the Spring '08 term at Michigan State University.

### Page1 / 2

HW2 - Computer Science 830: Design and Theory of Algorithms...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online