top of page
Writer's pictureApurba Paul

Singly Linked List-Part 6

This Function search an element from the list(if successful) otherwise not.

//Search Function void search() { int data,flag=0; printf("Enter data to be  searched:"); scanf("%d",&data); fflush(stdin); Node *tptr=start; while(tptr) { if(tptr->info==data) { flag++; } tptr=tptr->Link; } if(flag!=0) { printf("%d found %d times\n",data,flag); } else { printf("%d not found\n",data); } }

4 views0 comments

Recent Posts

See All

Comments


bottom of page