Divide and conquer
Recursion doesnt exist from operational perspective?
PC + Memory instruction + increment memory address.
recursion vs iterative - taking an implicit stack and turing it inot explicit stack.
tail recursive -- no looking back
D&C where we can break it down to smaller problem. Log N. Always first recursive and then formulated iteratively. Dynamically is not Static classes.
DP: Optimal substructure + overlapping subproblem
- Change counting problem.
Not a possible way. But the best possible way. We dont need to revisit previous solution. make a choice here at one point in time, is the best choice.
Greedy: 1. no dependence on future choices
- no reconsideration of choices
formulation 1: Now if it is shuffled?
formulation 2: all possible choices?
Optimal substructure: instead of
a star. djistras -- X -> negative weight.
bellman ford --< Y negative weight>
first optimital substructure second overlap - memoization