CS Week 9 - Recursion Flashcards

1
Q

algorithm

A

a sequence of steps for solving a problem

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

recursive algorithm

A

an algorithm that breaks the problem into smaller subproblems and applies the same algorithm to solve the smaller subproblems

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

base case

A

how to actually do something
where the recursion ends

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

recursive function

A

a function that calls itself

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

creating a recursive function

A

1.write the base case
returns a value without performing a recursive call

2.write the recursive case

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

a few that can be solved with recursion

A

Fibonacci sequence
greatest common divisor
binary search
finding all possible combinations
finding all possible subsets of a set of items
finding all possible paths

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

stack frame

A

for local parameters, local variables, and more function items
Upon return, the frame is deleted

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

stack overflow

A

meaning a stack frame extends beyond the memory region allocated for stack

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

binary search

A

algorithm begins at the midpoint of the range and halves the range after each guess

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