Skip to content

Latest commit

 

History

History
8 lines (8 loc) · 346 Bytes

File metadata and controls

8 lines (8 loc) · 346 Bytes
  • Type: Graph (dfs/bfs)
  • Approach:
    • Dfs: use basic dfs to traverse each room and use a visited set to store the visited room.
    • Bfs: use basic bfs to traverse each room and use a visited set to store the visited room.
  • Complexity:
    • Time: O(V+E)
    • Space: O(V)