Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Modify the linked list program to include a search. The search should allow the

ID: 3635334 • Letter: M

Question

Modify the linked list program to include a search. The search should allow the user to enter a part number and then search the list and print out the complete information for that part.

Explanation / Answer

Hi, hope this will help u anything u don`t understand message me and i will be glad to help =) Search An Element in Linked List #include #include #include struct linlst { int info; struct link *next; } start, *node; int search(int); void main() { int no,i,item,pos; clrscr(); start.next=NULL; node=&start; printf("How many nodes, you want in linked list? "); scanf("%d",&no); printf(" "); for(i=0;inext=(struct linlst *)malloc(sizeof(struct linlst)); printf("Enter element in node %d: ",i+1); scanf("%d",&node->info); node=node->next; } node->next=NULL; printf(" Linked list(only with info field) is: "); node=&start; while(node->next!=NULL) { printf("%d ",node->info); node=node->next; } printf(" Enter item to be searched : "); scanf("%d",&item); pos=search(item); if(posnext!=NULL) { if(node->info==item) break; else n++; node=node->next; } return n; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote