3132333435363738394041
n8.addNeighbors(new GraphNode[]{n2, n6, n7}); n0.printDFS(); GraphNode copy1 = cloneGraph(n0, new HashMap<GraphNode, GraphNode>()); copy1.printDFS(); GraphNode copy2 = cloneGraph(n0); copy2.printDFS(); }
3435363738394041424344
GraphNode copy1 = cloneGraph(n0, new HashMap<GraphNode, GraphNode>()); copy1.printDFS(); GraphNode copy2 = cloneGraph(n0); copy2.printDFS(); } // ---------------------------------- // Clone graph - DFS recursion // ----------------------------------