Q1 Solve the Recurrence Relation Iteratively(Without Using Master S Theorem)

Q1 Solve the Recurrence Relation Iteratively(Without Using Master S Theorem)

<p> COT 5405 Analysis of Algorithms Fall 2004</p><p>On-Campus Exam #1</p><p>Name: ______</p><p>UFID: ______- ______</p><p>E-mail: ______</p><p>Instructions:</p><p>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 only TWO problems. If you attempt more than two problems, we will grade the First two of them. If you forget to mark it and tell us right after the exam, even then we would correct the first two only. 4. Each problem carries 10 points 5. Total time for the exam is 50 minutes 6. You are not allowed to use a calculator for this exam</p><p>I have read carefully, and have understood the above instructions. On my honor, I have neither given nor received unauthorized aid on this examination.</p><p>Signature: ______</p><p>Date: ____ (MM) / ____ (DD) / ______(YYYY)</p><p>Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 1 of 7 Question 1:</p><p>Solve the recurrence relation without using Master’s theorem:</p><p>T(N) = 3T(N/2) + cN (c is a constant)</p><p>Derive a Theta expression for T(N). </p><p>Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 2 of 7 Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 3 of 7 Question 2:</p><p>A and B are playing a guessing game where B first thinks up an integer X (positive, negative or zero, and could be of arbitrarily large magnitude) and A tries to guess it. In response to A’s guess, B gives exactly one of the following three replies: a) Try a bigger number b) Try a smaller number or c) You got it!! </p><p>Design an efficient algorithm to minimize the number of guesses A has to make. An example (not necessarily an efficient one) below:</p><p>B thinks up the number 35 A’s guess B’s response 10 Try a bigger number 20 Try a bigger number 30 Try a bigger number 40 Try a smaller number 35 You got it</p><p>Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 4 of 7 Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 5 of 7 Question 3:</p><p>There are n students in a class. The test results are out and assume, for your convenience, that all the students had distinct grades (numbers). You can think of the test result as an unsorted integer array. A student X has been told that his rank in the class is R (R is an integer and obviously, 1 <= R <= n). He wants to find out the k boys who are ranked closest to him (k/2 students below him, and k/2 students above). Devise an efficient algorithm to identify the scores of these k boys.</p><p>Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 6 of 7 Analysis of Algorithms Fall 2004 On-Campus Exam #1 Page 7 of 7</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us