Finals05 - COT 5405 Analysis of Algorithms Spring 2005...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COT 5405 Analysis of Algorithms Spring 2005 On-Campus Comprehensive Exam Name: __________________________________________ UFID: ____________ - ____________ E-mail: _________________________________________ Instructions: 1. Write neatly and legibly 2. While grading, not only your final answer but also your approach to the problem will be evaluated 3. You have to attempt ALL THREE problems. You have choices under each problem. 5. Total time for the exam is 120 minutes 6. You are not allowed to use a calculator for this exam I have read carefully, and have understood the above instructions. On my honor, I have neither given nor received unauthorized aid on this examination. Signature: _____________________________________ Date: ____ (MM) / ____ (DD) / ___________ (YYYY) Analysis of Algorithms Spring 2005 On-Campus Final Exam Page 1 of 15
Background image of page 1

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

View Full DocumentRight Arrow Icon
Q1. Please attempt only 2 out of the following 3 subparts (7.5 points each = total 15 points) a) You are interested in analyzing some hard-to-obtain data from two separate databases having n and m numerical values – so there are n + m values in total – and you may assume that no two values are the same. You’d like to determine the median of this set of n + m values, which we will define here to be the ( n + m )/2 th smallest value. However, the only way you can access these values is through queries to the databases. In a single query, you can specify a value k to one of the two databases, and the chosen database will return the k th smallest value that it contains. Give an efficient algorithm that finds the median assuming that each query to any of the databases requires constant time. Also, derive the asymptotic complexity of your algorithm. (Hint: For your convenience, you may assume that both
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/27/2011 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.

Page1 / 15

Finals05 - COT 5405 Analysis of Algorithms Spring 2005...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online