mids - Design and Analysis of Computer Algorithms Midterm...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Design and Analysis of Computer Algorithms Midterm Exam Solution 13:10-15:00 pm Monday, April 14, 2008 Name: ID #: This is a Close Book examination. Only an A4 cheating sheet belonging to you is acceptable. You can write your answers in English or Chinese. Maximum Score Problem 1 24 24 Problem 2 16 16 Problem 3 10 10 Problem 4 10 10 Problem 5 15 15 Problem 6 15 15 Problem 7 10 10 Total 100 100 1 1. (24 pts) Please consider the following equalities. Mark by T(=true) or F(=False) each of the following statements. You don’t need to prove it. (1) ∑ n i =1 √ i = O ( n 3 2 ) (2) n n = O (2 n ) (3) n ! = O ( n n ) (4) n 2 log n = Θ( n 2 ) (5) n 2 / log n = Θ( n 2 ) (6) 33 n 3 + 4 n 2 = Ω( n 2 ) Question Answer (1) T (2) F (3) T (4) F (5) F (6) T 2. (16 pts) Suppose A is a problem with a well-known lower bound Ω( T ( n )) and B is a problem of which the lower bound is unknown. However, we can find a O( n )-time reduction from A to B . Mark by T(=true) or F(=False) each of the following statements: (1) If B can be solved in O( n 2 ), then A can be solved in O( n 2 ). (2) If A can be solved in O( n 2 ), then B can be solved in O( n 2 ). (3) If T ( n ) = log n , then B has an Ω(log n ) time lower bound. (4) If B has an Ω(log n ) time lower bound, then T ( n ) = log n . Question Answer (1) T (2) F (3) F (4) F 2 3. (10 pts) Use a recursion tree to determine a good asymptotic upper bound on the recurrence T ( n ) = T ( n 3 ) + T ( 2 n 3 ) + O ( n ) . Furthermore, use the substitution method to verify your answer. Sol: The recursion tree is in Figure 1. Summing up all the terms on the right-hand side of the tree, we can guess c ( n /3) log 3/2 n c (2 n /3) cn cn c n Total: O( n log n ) c ( n /9) c (2 n /9) c (2 n /9) c (4 n /9) Figure 1: The recursion tree for the recurrence relation in problem 4.Figure 1: The recursion tree for the recurrence relation in problem 4....
View Full Document

This note was uploaded on 05/11/2010 for the course COMPUTER S 301 taught by Professor . during the Spring '10 term at Kadir Has Üniversitesi.

Page1 / 7

mids - Design and Analysis of Computer Algorithms Midterm...

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

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