# Finals04 - COT 5405 Analysis of Algorithms Spring 2004...

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

COT 5405 Analysis of Algorithms Spring 2004 On-Campus Final 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. Please pay close attention to the choices available. If you attempt more problems than we have asked for, we will grade ANY problems of OUR choice 4. Problems carry different points (total 35 points) 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)

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

View Full Document
Analysis of Algorithms On-campus Final Exam Spring 2004 Q1. Please attempt only 2 out of the following 3 subparts (7.5 points each = total 15 points) a. Devise a divide-and-conquer algorithm to partially sort n distinct integers so that each sorted number is placed at a position with distance less than k of the position where it should have been if it were fully sorted . Justify its complexity. ( You can assume that n = m * k ). Observe that when k =1, we obtain full sorting. As for example, for input integer set A [10] = {5, 1, 4, 8, 7, 2, 10, 9, 6, 3}, if we fully sort this, we will get {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, i.e., A [ i ] = i . With k = 2, the partially sorted output may look like {1, 2, 4, 3, 5, 6, 8, 7, 10, 9}. Note that in this output, no number is at a distance of 2 or more from its correct position when sorted. Page 2 of 14
Analysis of Algorithms On-campus Final Exam Spring 2004 Page 3 of 14

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

View Full Document
Analysis of Algorithms On-campus Final Exam Spring 2004 There are n students in a dorm equipped with a single computer connected to the Internet.
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 / 14

Finals04 - COT 5405 Analysis of Algorithms Spring 2004...

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

View Full Document
Ask a homework question - tutors are online