Skip to content

A short algorithm to find a path in a Maze, implementing linear data structures such as Queues (Linked List).

Notifications You must be signed in to change notification settings

gabopushups/PathFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PathFinder

A short algorithm to find a path in a Maze, implementing linear data structures such as Queues (Linked List). The algorithm consists of the following;

Setup

  1. Initialize maze dimensions and walls. Set start and end positions
  2. Create a queue of the positions that will be visited, called toVisit.
  3. Set the current position to start. Add it to toVisit.

Iterate until toVisit is empty

  1. Pop the current position from toVisit
  2. Verify if the current position is equal to the end position. If yes, we are done.
  3. For the current position, check its 4 neighbors and add them to a queue named neighbors
  4. Empty the neighbors queue and add them to toVisit.
  5. Go back to 4.

About

A short algorithm to find a path in a Maze, implementing linear data structures such as Queues (Linked List).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages