Implemented DFS traversal using adjacency list