Hi Sameer,
"Sameer" <> wrote in message
news:bk49us$nsql6$...
....
| > A data structure for the implementation of graph can be
| >
| > struct node
| > {
| > int index;
| > struct node *next;
| > };
| >
| > struct adjnode // node adjacent to node
| > {
| > int adjindex;
| > struct node *next;
| > struct adjnode *next;
| > };
....
| sorry the currect input file is
|
| node1 adjnode2 adjnode3
| node2 adjnode1 adjnode4
| node3 adjnode1 adjnode4
| node4 adjnode2 adjnode3
Unfortunately, your question remains too vague.
There are many kinds of graphs (cyclic/acyclic,
oriented or not, ...), and even more ways
to represent them using different data structures.
From your post, I still do not understand how
struct node and struct adjnode are intended to
be used.
I think you need to tell more about your
goals/constraints/requirements.
Regards,
Ivan
--
http://ivan.vecerina.com