This is the picture form of the representation i looking for.

This is what i have did so far.Code:#include<stdio.h> #include<ctype.h> #include<stdlib.h> #include<assert.h> #include<math.h> #include "AdjacencyList.h" // ------------------------------------------------------- // ------------------------------------------------------- int main(int argc, char *argv[]) { struct vertex *root_Vertice = 0; struct vertex *vertices = 0; root_Vertice = root_vertex_allocate(&root_Vertice); vertices = vertex_allocate(vertices); root_Vertice = InsertVertex(&root_Vertice, vertices, 1); printf("%d", (*root_Vertice).next_Vertices->valueOfVertices); return 0; } // ------------------------------------------------------- struct vertex* root_vertex_allocate(struct vertex **root_vertice) { (*root_vertice) = (struct vertex*)malloc(sizeof(struct vertex)); assert(*root_vertice != 0); (*root_vertice)->next_Vertices = NULL; return *root_vertice; } // ------------------------------------------------------- struct vertex* vertex_allocate(struct vertex *myVertex) { myVertex = (struct vertex *)malloc(sizeof(struct vertex)); assert(myVertex != 0); myVertex->next_Vertices = NULL; return myVertex; } // -------------------------------------------------------- void vertex_deallocate(struct vertex *myVertex) { if (myVertex != NULL) { free(myVertex); } } // -------------------------------------------------------- struct vertex* InsertVertex(struct vertex **root_vertice, struct vertex *vertex, int value) { struct vertex *traversal; if ( (*root_vertice)->next_Vertices == NULL ) { (*root_vertice)->next_Vertices = vertex; vertex->valueOfVertices = value; } else { traversal = (*root_vertice)->next_Vertices; while(traversal->next_Vertices != NULL) { traversal = traversal->next_Vertices; } traversal->next_Vertices = vertex; vertex->valueOfVertices = value; } return *root_vertice; } // -------------------------------------------------------- struct edge* edge_allocate(struct edge *myEdge) { myEdge = (struct edge *)malloc(sizeof(struct edge)); assert(myEdge != 0); return myEdge; } // -------------------------------------------------------- void edge_deallocate(struct edge *myEdge) { if (myEdge != NULL) { assert(myEdge != 0); free(myEdge); } } // -------------------------------------------------------- #ifndef _AdjacencyList_ #define _AdjacencyList_ struct vertex { int valueOfVertices; // Value of vertices struct vertex *next_Vertices; }; struct edge { int weightage; // Weightage of a edge struct edge *edges; // }; // -----------------------Vertex Function---------------- struct vertex* root_vertex_allocate(struct vertex **); struct vertex* vertex_allocate(struct vertex *); void vertex_deallocate(struct vertex *); struct vertex* InsertVertex(struct vertex **, struct vertex *, int); struct vertex* RemoveVertex(struct vertex *); void displayGraph(struct vertex *); // ------------------------------------------------------- // -----------------------Edge Function------------------- struct edge* edge_allocate(struct edge *); void edge_deallocate(struct edge *); // ------------------------------------------------------- #endif