Define : compute knowing optimal splits are in .
Base case: if , return.
Compute .
Find by trying all . Track which was best as .
Recurse: and . Understanding this concept will help you solve more complex problems.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Step by step
Define : compute knowing optimal splits are in .
Base case: if , return.
Compute .
Find by trying all . Track which was best as .
Recurse: and . Understanding this concept will help you solve more complex problems.