ITS FINALLY HERE!!! dp... dp... dp...
i was scared of these problems, but they seemed so fun. dp is not easy. after doing some of the problems, dp is all about practice. practice is sooo important for this. pattern recognition and reasoning through, and drawing out the problem is the absolute way to do it.
Some tricks for DP:
- Just started DP problems. I didn't do half bad. I'm reasoning my way through all of the problems, getting really close to the answers. Most DP problems look like they are supposed to be solved bottom-up.
- From the smallest sub problem, to the actual answer.
- To recognize DP problems, they kinda look like induction problems, and have a way of using a previous answer. If you are given a choice at each "step" maybe think about the possibility of a DP problem.
- Memoization is the process of holding all the previous answers in some other data structure.
- GO through the steps of induction with DP problems. I feel like that makes more sense to me.
- Sometimes you don't even need a data structure with DP, maybe just a couple of variables (one of the problems I had today)
No comments:
Post a Comment