This preview shows pages 1–2. Sign up to view the full content.
Signature ______________________
Name_________________________
Student ID _____________________
Score:
Quiz 4
CSE 21
Spring 2010
Which version (recursive or iterative or both) of Fib(n) will be more time and space efficient? _____
A) recursive
B) iterative
C) both are equal
What is the main reason why? _____
A) recursive version is shorter
B) recursive version implicitly uses the run time stack
C) iterative version does not recompute all the previously computed fib values
D) iterative version uses looping
E) recursive version takes advantage of one or two base case(s)
F) iterative version calls the recursive version so they are equal
G) both versions have the same bigOh complexity
H) both versions have the same recurrence relation and closed form solution
What is arguably the most important precondition for the binary search algorithm? _____
A) the data is already ordered/sorted
B) the key we are searching for is in the array
C) the key we are searching for is even
D) the number of data elements is even
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.
 Spring '10
 CS

Click to edit the document details