Recursion Flashcards
What data structure is used to keep track of recursion?
A stack.
Stack frames (or activation records) reference what?
A complete copy of the method definition.
When condition occurs when a stack attempts to grow beyond its limit?
Stack overflow.
Any task that can be done using recursion can also be done iteratively.
True.
Recursive methods usually run faster than their iterative counterparts.
False, they will usually run slower.
Iterative versions of methods usually use more storage than the recursive versions.
False, recursively written methods will usually use more storage.
Recursion is not limited to void methods.
True.
Recursive methods can return a value of any type.
True.
What is the worst-case running time of the binary search algorithm (using big O notation)?
O(log n)
What is the worst-case running time of a serial search algorithm (using big O notation)?
O(n)