Introduction - If you have any usage issues, please Google them yourself
Queue-based algorithm visits the cells surrounding the starting point then branches out to cells at next further distance, and then the next further distance. Because queue pops out what is stored first inside and visits a neighboring cell of the least recently visited cell with undiscovered neighboring cells.