This is a game where you find your way through the maze, playing small quizzes and games on the way
DFS(Depth-First Search)
This is about searching as deeply as you could. Once there is a deadend(if you can't go further), you go back to the latest crossroad(where there were more choice of path) and continue with the search.
In order to go back to the crossroad, it is crucial that you store the node you visited by using stack implicitly.
However, this search algorithm could be time-consuming in that it implements recursion, especially if the key is in the last node of last path.
BFS(Breadth-First Search)
Breadth-First Search is more about speading to different paths, rather than digging in deeply(like DFS). Therefore, you use queue to store the nodes to visit in the future.
This algorithm has advantage in that it is less time-consuming compared to DFS algorithm. However, DFS would perform better if the key node is in the last node of first path.
Struct is similar to class, except that it lacks function. That is, it is composed with data only.
Array is a data structure where you could store many data of same type.
Therefore, Struct array refers to array of struct type.
struct XY{
int a;
int b;
}; //struct
struct XY his[MAX_STACK_SIZE]; //struct array
We used textfile with different numbers to display path and different traps as an input.
0 is a wall, 1 is the path, 2 and 3 is where the trap even occurs, 5 is the starting point and 9 is the end of maze. With the textfile as input, we allocated int arrays dynamically.