13(i) Write a chopine to create a running(a) associate agree interactively and printout the lean and total amount of items in the list.PROGRAM# admit #include #define postal code 0struct linked_list{int number;struct linked_list *next;}; fictitious characterdef struct linked_list client;main (){int n; client * query = deceitful; vanity print( boss *p);node *insert_Sort(node *p, int n);printf(Input the list of numbers.n);printf(At end, type -999.n);scanf(%d,&n);while(n !
= -999){if( encompass == NULL){head = (node *)malloc(sizeof(node));head ->number = n;head->next = NULL;}else{head = insert_sort(head,n);}scanf(%d, &n);}printf(n);print(head);print(n);}node *insert_sort(node *list, int x){node *p1, *p2, *p;p1 = NULL;p2 = list;for( ; p2->number < x ; p2 = p2->next){p1 = p2;if(p2->next == NULL){ sep2 = p2->next; analyze;}}p = (node *)malloc(sizeof(node)); /* space for virgin node */p->number = x; /* put down value in the bleak node */p->next = p2; /* link sore node to key node */if (p1 == NULL)list = p;elsep1->next = p; show (list);}void print(node *list){...If you want to honoring a full essay, put together it on our website: Ordercustompaper.com
If you want to get a full essay, wisit our page: write my paper
No comments:
Post a Comment