Initialize an empty stack and push room 0 into it.
Initialize an empty set to keep track of visited rooms.
While the stack is not empty:
a. Pop a room from the stack.
b. If the room has not been visited:
i. Add the room to the set of visited rooms.
ii. Iterate over the keys in the current room and push them onto the stack if they haven't been visited.
After the loop, check if the number of visited rooms is equal to the total number of rooms.
Return true if all rooms have been visited, otherwise return false.