Home > Back-end >  Bosses, using C language to work out this problem
Bosses, using C language to work out this problem

Time:09-20

. Write a program to solve the maze problem, the labyrinth is a m n columns of 0-1 matrix, where 0 means no obstacle, 1 said, set the entry (1, 1), exports (m, n), each move only from a barrier-free unit office moved to the surrounding eight directions without obstacle unit, program gives a path through the maze,
Requirements: (1) enter the maze matrix m * n, such as:

6 and 9

1 0 0 0 1 1 0 0 0
1 0 0 0 0 1 1
1 1 0 0 0 0 0 1 1
1 1 1 1 1 1 0 0
1 1 0 0 0 1 0 0
0 0 1 1 1 1 1 0 0

(2) output through a maze of paths (reverse path process shows), if there is no way, no maze is output: there is no path,

CodePudding user response:

Depth-first traversal and breadth-first traversal, textbook is the source code, there are also many online,

CodePudding user response:

reference 1/f, confident boy reply:
depth-first traversal and breadth-first traversal, textbook is the source code, there are also many online,

Bosses, can you give a ah, I went through the book, only the simplified version, see not too understand, online is mostly C + +, C language is also rare,