Recursion Flashcards
1
Q
What is recursion?
A
An algorithm that breaks the problem into smaller subproblems
2
Q
a method that calls itself is called…
A
a recursive method
3
Q
A binary search starts at…
A
this mid-point of the range and halves the ranges after each guess
4
Q
What is returned when no match is found.
A
-1
5
Q
How to calculate the midPoint?
A
(highVal + LowVal) / 2
6
Q
What is the purpose of an output statement?
A
Help with debugging
7
Q
The recursion methods can solve problems like…
A
The Fibonacci Sequence
Greatest Common Divisor
8
Q
If the bas case is missign or erroneous what happens to the recursive algorithm?
A
It will go on forever hence creating an infinite loop
9
Q
A
10
Q
A
11
Q
A
12
Q
A