Data - Lesson 21 - recursive after-school practice

Lesson 21 - recursive after-school practice

 

1. permutation.c whole ranking algorithm of the processing elements in the set can vary case. Algorithm design, it can be arranged on the full set of repeating elements.

 

2. Find a program from the beginning to the end of the maze path!

prompt

(1) can be represented by a two-dimensional array maze.

l element 1 represents obstacles.

l represents 0 element accessible.

(2) create a two-dimensional array and the size of the maze as a marker array.

l when the flag is 0 and the array position corresponding to the position of the labyrinth is 0, can pass.

(3) using the backtracking "Pathfinder."

When the current road impassable l, numeral 1 in the flag array corresponding to the position, and back.

 

If you can find the maze beginning to the end of all paths

Guess you like

Origin www.cnblogs.com/free-1122/p/11322830.html