I think adjacency list can be implemented by vector of vector. vector< vector<int> > Nodes; The size of vector Nodes is total no of nodes. Every element of the vector will store all its adjacent edges. Nodes[i] is a vector containing all the edges adjacent to node i. So, we can copy the graph easily.
On Wednesday, 25 April 2012 17:40:16 UTC+5:30, Radhakrishnan IT wrote: > > How will you implement a graph data structure ? > Give an linked implementation as we do not know how many nodes will be > there and how many edges will be there. > Make a copy of this graph.. > > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/w49HbR_IySIJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
