Adjacency list in c with void functions

Incomplete code are shown as follow:

typedef struct _Node{     char name[100];     int id;     struct _Node *next; } Node;  typedef struct _Adj_Row{     Node *header;     struct _Adj_Row *next; } Adj_Row;  typedef struct{     Adj_Row *header; } Adj_List;  void InsertNode(Adj_List *g, int x, char name[]){     Node* new_node = malloc(sizeof(Node));     new_node -> id = x;     **strcpy (new_node->name,name);**     new_node -> next = NULL;      if (g->header == NULL){         Adj_Row *p = g->header;         p->header = new_node ;         p->next = NULL;     }     else{         Node *c = (g->header)->header;         While(c->next!=NULL){             if ( c->id == x ){                 printf("\nDuplicated node.");             }             if ( c->next->id > x){                 Node *temp = c->next;                 c->next = new_node;                 new_node->next = temp;                 break;             }             c = c->next;         }     } }  int main(){     char command[100];     Adj_List g;     g.header=NULL;      while (scanf("%s", command)){         if (strcmp(command, "InsertNode")==0){             int x;             char name[100];             scanf("%d %s", &x, name);             InsertNode(&g, x, name);         }         else if (strcmp(command, "InsertEdge")==0){             int x, y;             scanf("%d %d", &x, &y);             InsertEdge(&g, x, y);         }     }     return 0; } 

I am struggling with the implementation of InsertNode. After I have created a new node, I am not sure how to initialize it in the Adj_Row and the Adj_list as defined. The InsertNode also has the following requirment:

1.If the id of the node has been existed already, output “Duplicated node.” on screen.

2.The id of the nodes is an integer which may not start from 0 and may not be in ascending order.

3.The node should be stored in the ascending order of the id of the node.

I have tried to implement, but I don’t exactly know what the problem is.

Sample input:

InsertNode 1 Shop

InsertNode 2 Bakery

InsertNode 0 Home

InsertNode 3 Bank

The output would be:

Home

Shop

Bakery

Bank