Recursion Flashcards

(3 cards)

1
Q

What is the key structure of a recursive function ?

A

Base case - stopping point,
Recursive case - breaks the problem into smaller subproblems and calls itslef on them.

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

Explain the divide and conquer method.

A

Divide the problem into smaller subproblems,
Conquer by solving the subproblems recursively,
Combine the solutions to form the final answer.

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

Is recursion efficient ?

A

Yes and No; depends on the problem,
Problem wtih simple iterative solutions - efficient.

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