Master BFS & DFS (Iterative & Recursive)
Note: When multiple neighbors are available, visit them in alphabetical order.