# ps2 - Problem Set #2 IE 495 Due September 18 Written...

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

Problem Set #2 IE 495 Due September 18 Written Problems 1. Show that a recursive algorithm with running time satisfying T (1) = 1 T ( n ) = T ( n - 1) + f ( n ) satisfies T ( n ) Θ ( n 2 ) if f ( n ) Θ ( n ). 2. The sequence of Fibonacci numbers, f 1 , f 2 , f 3 , . .. is defined recursively as follows: f 1 = f 2 = 1 f n +2 = f n + f n +1 Develop a nonrecursive linear-time algorithm to return the n th Fibonacci number . Show that the running time of the recursive algorithm based on the definition is ϖ ( n ). 3. In class, we saw how to implement insertion sort using arrays. This implementation runs in Θ ( n 2 ) time in both the average and worst case. Suppose we use linked lists instead of arrays. What are the worst case and average case running times for the search step? What are the worst case and average case running times for the insert step? What is the overall worst case and average case running times? For a given set of input data, which implementation will be faster?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 08/06/2008 for the course IE 495 taught by Professor Linderoth during the Fall '08 term at Lehigh University .

### Page1 / 2

ps2 - Problem Set #2 IE 495 Due September 18 Written...

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

View Full Document
Ask a homework question - tutors are online