t2ans - CS3230 Tutorial 2 1. Which of the following...

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

View Full Document Right Arrow Icon
CS3230 Tutorial 2 1. Which of the following recurrence relations can be solved using the master theorem? If it cannot be solved, state so. If it can be solved, give the answer (in terms of Θ notation) and state which clause of the master theorem applies. (a) T ( n ) = 15 T ( n/ 3) + n 3 . Ans: Yes. a = 15, b = 3, k = 3, b k = 3 3 > a . Thus, T ( n ) = Θ( n 3 ). (b) T ( n ) = 3 T ( n/ 2) + n . Ans: a = 3 , b = 2 , k = 1. Thus, a > b k . Thus, T ( n ) = Θ( n log 2 3 ). (c) T ( n ) = 4 T ( n/ 2) + n 2 . Ans: a = 4 , b = 2 , k = 2. Thus, a = b k . Thus, T ( n ) = Θ( n 2 log n ). (d) T ( n ) = T ( n/ 3) + T (2 n/ 3) + n . Ans: No. (e) T ( n ) = 4 T ( n/ 3) + n log n . Ans: Yes, by taking a = 4 , b = 3 , k = 1 + ± , where 1 < 1 + ± < log 3 4, we see that n 1 f ( n ) n 1+ ± , for large enough n . Thus, T ( n ) = O ( n log 3 4 ). Similarly, as f ( n ) = Ω( n ), we have that T ( n ) = Ω( n log 3 4 ). Giving us T ( n ) = Θ( n log 3 4 ). 2. Use induction to detmine the upper bound for the following recurrence relations. Express your answer in big O -notation. (a)
Background image of page 1

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

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

This note was uploaded on 01/06/2012 for the course CS 3230 taught by Professor Sanjay during the Fall '10 term at National University of Singapore.

Page1 / 4

t2ans - CS3230 Tutorial 2 1. Which of the following...

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

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