Clone a Directed Graph
Clone a given directed graph by making a deep copy of it.
We'll cover the following...
Statement
Given the root node of a directed graph, clone this graph by creating its deep copy, such that the cloned graph has the same vertices and edges as the original graph.
Example
Let’s look at the graphs below as an example. If the input graph is where is a set of vertices and is a set of edges, then the output graph (the cloned graph) is such that and .
Access this course and 1400+ top-rated courses and projects.