c++

Top-down

  • easier to write
  • memoization , usually store in hash map
  • recursion

Bottom-up

  • faster runtime
  • tabulation
  • iteration

The characteristic of the problems

  • ask for the optimum value
    • minimum, maximum
    • longest
  • decisions depend on earlier decisions
    • to distinguish to use greedy or DP