SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination SUBJECT: CS-233 Practical course based on CS231 /* Q2. There are lists where new elements are always appended at the end of the list. The list can be implemented as a circular list with the external pointer pointing to the last element of the list. Implement singly linked circular list of integers with append and display operations. The operation append(L, n), appends to the end of the list, n integers either accepted from user or randomly generated. */ #include<stdio.h> #include<stdlib.h> struct node { int data; struct node *next; }; struct node * create(struct node *head) { struct node *newnode = NULL, *temp = NULL; newnode = (struct node*) malloc(sizeof(struct node)); if(newnode!=NULL) { printf("Enter node data"); scanf("%d",&(newnode->data)); ...
Comments
Post a Comment