# Are DP problems backtracking with memoization

## Top-down Bottom-up Divide & Conquer Dynamic Programming Caching (Memoization) Branch-and-Bound Greedy

Transcript

1 2.2 Design paradigms top-down bottom-up divide & conquer dynamic programming caching (memoization) branch-and-bound greedy 1

2 Top-down break down the given problem into sub-steps Break down sub-steps into sub-sub-steps Break down sub-sub-steps into sub-sub-steps, etc. 2

3 Top-Down When implementing a sub-step, the sub-sub-steps are used as black boxes (specification!) Observe the sub-steps in the order of the smallest cross-references Avoid side effects 3

4 2.2 Design paradigms top-down bottom-up divide & conquer dynamic programming caching (memoization) branch-and-bound greedy 4

5 Bottom-up Solve partial problems and combine them into an overall solution Possible even with incomplete specifications Better test suites in parallel with development (design & implementation) Code reuse !? 5

6 2.2 Design paradigms top-down bottom-up divide & conquer dynamic programming caching (memoization) branch-and-bound greedy 6

7 Divide & Conquer Cont .: Problem of size n Divide: Break down the problem recursively into k sub-problems of size n / k Conquer: Solve small problems directly Combine the partial solutions to form the overall solution 7

8 Divide & Conquer Mostly: k = 2 Recursive implementation Intuitively easy to understand (actual algorithm hidden in the procedure calls) Effort described by recursion equations (master theorem) 8

9 Find MinMax iteratively MinMax (A [1..n]) min 1; max 1; i 2 while in do if A [i] A [max] then max ii i + 1 return (A [min], A [max]) T (n) = 2 n 2 ... (= 3 n 3) 9

- Are you bored of PubG
- Which muscles support the breasts
- What is Ghost Push Malware 1
- Climate change would take place without people
- Should I go to college or not
- Why does conformity feel like death
- Are there any professional alternatives to SmugMug
- Why not more philosophers legislators
- Libertarians think heroin should be legalized
- Should you die for love

- What do people learn in Christian camps
- What is the purpose of Skill India
- Coconut oil makes your wrinkles worse
- Were Morgoth's original orcs Avari elves corrupted
- What works as SDE in Amazon
- What do I do with this girl
- Sadism is a trait that is only reserved for humans
- Where can you place kinetic sculptures
- Which continent is Alaska on
- Triumph Motorraeder Bonneville versus Thruxton
- Which brokerage is best for option strategies
- Can someone explain these Wireshark codes to me
- What is an Insurance Process in Cognizant
- What are some typical bollywood papa dialogues
- What services would a libertarian government provide?
- What is a conditional sentence
- What is a good friend to you
- Is God wild and dangerous
- Is aluminum a non-biodegradable waste
- Does the repo rate affect bank interest rates
- How could hospitals be made more efficient?
- Is imprisonment worse than death
- How is the population of Sofia Bulgaria
- How do wild tarantulas get their food