Concept Flow - Spiral Matrix Traversal
Start with boundaries: top, bottom, left, right
Traverse from left to right along top row
Move top boundary down
Traverse from top to bottom along right column
Move right boundary left
Traverse from right to left along bottom row
Move bottom boundary up
Traverse from bottom to top along left column
Move left boundary right
Check if boundaries crossed
Yes
End traversal
We move around the matrix edges in a spiral by adjusting boundaries after each side traversal until all elements are visited.
