Recursion Flashcards

1
Q

What is recursion?

A

An algorithm that breaks the problem into smaller subproblems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a method that calls itself is called…

A

a recursive method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A binary search starts at…

A

this mid-point of the range and halves the ranges after each guess

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is returned when no match is found.

A

-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to calculate the midPoint?

A

(highVal + LowVal) / 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of an output statement?

A

Help with debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The recursion methods can solve problems like…

A

The Fibonacci Sequence
Greatest Common Divisor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly