Back to QuestionsPractice with This Question
Clone Graph
71K views•Asked at Salesforce•
Medium
Question Explain
Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Use a HashMap to track visited nodes and their clones (BFS or DFS).
Start Trying This Question Simulation
Practice answering orally or with text to get instant AI feedback.