Let’s code a very simple maze solver using depth first search algorithm 🙂 !
Note 1: this video does not explain the theoretical part.
Note 2: I’m overriding JFrame’s paint() method only as a convenience. Be warned though, in pratice, it’s not very recommended by more experienced programmers ok 🙂
Note 3: in the current implementation of DepthFirst class, all visited nodes of maze array will be filled with ‘2’ and won’t be cleaned up automatically.
Executable jar (java 6) –