Graph Traversal Basics

BFS/DFS on grids and components.


1. Which traversal guarantees shortest path in an unweighted graph?
2. Grid problems usually use which neighbor directions?
3. When should you mark a node visited to avoid duplicates?
4. If newColor equals the starting color in flood fill, the best action is:
5. What data structure supports BFS order?