[Solved] display of a single linked list is not as expected [closed]
[ad_1] You’ve written function create() in a bad way (for loop to be more detailed). You should write it in this way: for(int i = 1; i < n; i++) { struct node *x= malloc(sizeof(struct node)); x->data=a[i]; x->next=NULL; far->next=x; //connects the node far to x far=x; //shifts the node far to x now far will … Read more