[prev] 33 [next]

Problem-solving

Many people "get stuck" when faced with a new problem
  • where to start?
  • what approach should I use?
Some standard approaches/strategies and programming techniques
  • recursion ... solve a problem in terms of a simpler version of itself
  • higher-order functions ... package patterns of computation into generic tools
  • divide-and-conquer ... partition problem, solve sub-problems, combine results
  • dynamic programming ... cache intermediate results to improve performance
  • greedy algorithms ... for optimisation, choose best option at each step
  • backtracking ... make choices; in event of failure, unwind choices and try again