[Solved] why doesn’t my sorted code work in c? [closed]
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *nextPtr; }; struct node *firstPtr = NULL; void insertioon (int d){ struct node *np, *temp, *prev = NULL; int found; np=malloc(sizeof(struct node)); np->data = d; np->nextPtr = NULL; temp=firstPtr; found=0; while ((temp != NULL) && !found) { if (temp->data <d) { prev = temp; … Read more