GM stock solution of the problem is "dynamic programming" because it complies with the following features:
1, multi-stage solution model: Every day is a new stage;
2, no after-effect: define exact premise in the state, behind the stage of decision making decisions in front of the stage;
Do questions Summary:
- 122, 123 has its own particularity, it can be combined with the characteristics of the subject of the answer;
- No. 188 the most difficult problems, how to find out the initialization of the assignment;
- Other issues as long as the precise definition of the state, the state transition equation is not difficult to obtain, the stock is not difficult series of questions, have confidence to do it;
- If you are not familiar with this kind of problem, then do not start to go try to optimize space (ie compressed state) the wording, it is recommended to focus first consideration in the definition of the state and state transitions. After the write right, write the state of compression is very easy. These questions are space enough, non-essential state of compression. The state-space compression, the wording is relatively fixed, less familiar friends do not position ourselves to be one step.
The last question is monotonically stack, not so much with the entire series (count buy one get one, do together).