hbs0(1) - CS 473 Head-Banging Session 0 (January 2021,...

Info iconThis preview shows pages 1–2. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 473 Head-Banging Session 0 (January 2021, 2009) Spring 2009 CS 473: Undergraduate Algorithms, Spring 2009 Head Banging Session 0 January 20 and 21, 2009 1. Solve the following recurrences. If base cases are provided, find an exact closed-form solution. Otherwise, find a solution of the form ( f ( n )) for some function f . Warmup: You should be able to solve these almost as fast as you can write down the answers. (a) A ( n ) = A ( n- 1 ) + 1, where A ( ) = 0. (b) B ( n ) = B ( n- 5 ) + 2, where B ( ) = 17. (c) C ( n ) = C ( n- 1 ) + n 2 (d) D ( n ) = 3 D ( n / 2 ) + n 2 (e) E ( n ) = 4 E ( n / 2 ) + n 2 (f) F ( n ) = 5 F ( n / 2 ) + n 2 Real practice: (a) A ( n ) = A ( n / 3 ) + 3 A ( n / 5 ) + A ( n / 15 ) + n (b) B ( n ) = min < k < n ( B ( k ) + B ( n- k ) + n ) (c) C ( n ) = max n / 4 < k < 3 n / 4 ( C ( k ) + C ( n- k ) + n ) (d) D ( n ) = max < k < n D ( k ) + D ( n- k ) + k ( n- k ) , where D ( 1 ) = (e) E ( n ) = 2 E ( n- 1 ) + E ( n- 2 ) , where E ( ) = 1 and E...
View Full Document

Page1 / 2

hbs0(1) - CS 473 Head-Banging Session 0 (January 2021,...

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