This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 373 Midterm 1 Questions (October 1, 2002) Fall 2002 Write your answers in the separate answer booklet. 1. Multiple Choice: Each question below has one of the following answers. A: Θ(1) B: Θ(log n ) C: Θ( n ) D: Θ( n log n ) E: Θ( n 2 ) X: I don’t know. For each question, write the letter that corresponds to your answer. You do not need to justify your answers. Each correct answer earns you 1 point. Each X earns you 1 4 point. Each incorrect answer costs you 1 2 point. Your total score will be rounded down to an integer. Negative scores will be rounded up to zero. (a) What is n ∑ i =1 i n ? (b) What is n ∑ i =1 n i ? (c) How many bits do you need to write 10 n in binary? (d) What is the solution of the recurrence T ( n ) = 9 T ( n/ 3) + n ? (e) What is the solution of the recurrence T ( n ) = T ( n 2) + 3 n ? (f) What is the solution of the recurrence T ( n ) = 5 T ( n 17 25 lg lg n ) + πn +2 √ log * n 6? (g) What is the worstcase running time of randomized quicksort? (h) The expected time for inserting one item into a randomized treap is O (log n ). What is the worstcase time for a sequence of n insertions into an initially empty treap? (i) Suppose StupidAlgorithm produces the correct answer to some problem with proba bility 1 /n . How many times do we have to run StupidAlgorithm...
View
Full Document
 Spring '09
 A

Click to edit the document details