Tuesday

algorithm solving steps

  • REMEMBER READ THE PROBLEM STATEMENT AND DON'T SOLVE A DIFFERENT PROBLEM
  • REMEMBER LOOK FOR RANDOM UNINTUITIVE DETAILS IN THE PROBLEM
  • read the bounds for edge cases
  • function calls are not free
  • unordered naive is faster than lb vector standard

Steps:

  1. Clarify Questions
  2. High-level solution
  3. write out steps of your solution / pseudocode
  4. put some input and check if it works
  5. put input in here

Framework for solving DP problems:

  1. Define the objective function
  2. Identify base cases
  3. Write down recurrence relation ( or transiotion function) for the optimized objective function
  4. What is the order of execution ? (top to buttom or buttom to top)
  5. Where to look for the answer

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...