I am trying to implement a randomly generated maze using Prim’s algorithm in Java. However, after reading up on Wikipedia and other answers, there’s minimal explanation on how the implementation I found actually works. For example: What is a simple explanation for what the LinkedList is doing? Answer It’s the queue that backs a BFS (Breadth First Search) algorithm. See