Home > Back-end >  C horse day
C horse day

Time:09-15

Horse from (0, 0), only to the right (upper or lower) jump, from (0, 0) to (8, 4). This area is how many different paths, and print out the various paths,

Below are subject to provide train of thought, I don't know much about:
(1) in view of the coordinate Point in the title, we design a Point class to describe our current of the state, record the abscissa and ordinate,
(2) to print out a path, you need a dynamic array to record point, by the use of the STL vector can be implemented, the corresponding application path, its type is vecetor ,
(3) to record all the paths, we need a record "of" a complete path of dynamic array, the corresponding program of ret, type of vector ,
(4) in view of the current state of our, we can according to the rule extension in the topic of the next step can reach the state of the node (be careful not to cross), namely the selection list, the corresponding program of ls, the type of course is vector ,
(5) from the current node when we make a "choice" (namely the corresponding to the point, next to ST), the need to remove the "select" from the select list, and will add to the path of the "choice", and then continue to do "choice", according to the rule extension node until she reached the target node; You then need to add back in the select list ST,

Do you have any brother can guide, give a thought

CodePudding user response:

Point (5, 5), for example, to only go next day, the first is the abscissa, for 3,4,6,7, ordinate are similar, only for 3,4,6,7
  • Related