hw8 - CS 173: Discrete Structures, Fall 2010 Homework 8...

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

View Full Document Right Arrow Icon
CS 173: Discrete Structures, Fall 2010 Homework 8 This homework contains 3 problems worth a total of 38 regular points. It is due on Friday, October 29 at 4pm. Put your homework in the appropriate dropbox in the Siebel basement. 1. More on recurrences [12 points] (a) (6 points) Derive closed form solutions for the following two recurrences. i. T (0) = 2 and T ( n ) = ( n + 1) T ( n - 1) . ii. T (0) = 1 and T ( n ) = T ( n - 1) + 3( n - 1) 2 + 3( n - 1) + 1 . (b) (6 points) Give a closed form of the following recurrence using a recursion tree. Assume n is a power of 2. i. T (1) = 1 and T ( n ) = 4 T ( n/ 2) + n 3 2. Algorithm analysis [10 points] Consider the following code. Its output is a new array b 1 , b 2 , . . . , b k . (Don’t worry about the details of how this new array is created.) 1. Proc funct( a 1 , a 2 , . . . a n : array of real numbers) 2. k = 1 3. b k = a 1 4. for i = 2 to n 5. c = 0 6. for j = 1 to i - 1 7. c = a j + c 8. if ( a i c ) 9. k = k + 1 10. b k = a i 11. return
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 12/06/2010 for the course CS 173 taught by Professor Fleck@shaffer during the Spring '08 term at University of Illinois at Urbana–Champaign.

Page1 / 2

hw8 - CS 173: Discrete Structures, Fall 2010 Homework 8...

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