当前位置: 动力学知识库 > 问答 > 编程问答 >

data strucuture for Maze in C

问题描述:

All I want to do is create a maze which is nothing but a n*n square with goal state (one cell), blocked cells and a start cell. I then plan to apply DFS and BFS on the maze to find a path from start state to goal state. I am stuck as to what data structure should I use for representing my maze?? Any suggestions??.

网友答案:

If that's the exact way that you want to represent it, then use a 2D array (an array within an array) of numbers. Then, the number zero means something is open, the number one means something is blocked, and two is your goal.

分享给朋友:
您可能感兴趣的文章:
随机阅读: