Divide-and-Conquer Flashcards

1
Q

In recursion, what is ‘recursive case’, and what is ‘base case’.

A

When the subproblems are large enough to solve recursively, we call that the ‘recursive case’. Once the subproblems become small enough that we no longer recurse, we say that is ‘base case’.

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

What are the methods for obtaining asymptotic Big Theta or Big O bounds on the divide-and-conquer solutions?

A
  • Substitution method - guess a bound and then use mathematical induction to prove the guess correct.
  • Recursions-tree method - convert the recurrence into a tree whose nodes represent the costs incurred at various levels of the recursion.
  • The Master method - provides bounds for recurrences of the form: T(n) = aT(n/b) + f(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name few examples of problems which can be solved using divide-and-conquer approach.

A
  • Sorting
  • Maximum subarray
  • Matrix multiplication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly