No test case for unconnected graph


#1

The ‘expected output’ shows that unconnected graph isn’t handled properly.

Either test cases and reference solution should be fixed, or the problem should state that only connected graphs are considered.


#2

you didn’t understand the argument of function then which is
" cloneGraph ( UndirectedGraphNode *node ) "

argument is " UndirectedGraphNode *node "
which is just a pointer to UndirectedGraphNode NODE.
if they want to give unconnected test cases then they would have given it as a
LIST of " UndirectedGraphNode * ".
so our new function would look like
UndirectedGraphNode * cloneGraph( vector<UndirectedGraphNode *> vertices)


#3

You are a good repy.