[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-685736-105":59,"doc-detail-685736-en":130,"doc-similar-685736":153},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","singly-linked-list-in-c-c-program-linked-list-operations-menu","Singly Linked List in C - C Program - Linked List Operations Menu","","Singly linked list implementation in C using a node structure and a global head pointer, providing core operations through functions. The program presents a text-based main menu for inserting nodes at the beginning, at the end, or after a specified location, deleting nodes from the beginning, from the last position, or after a given location, and searching for an element. It also includes a display routine to traverse and print all stored values, along with basic input handling and empty-list/overflow checks.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/singly-linked-list-in-c-c-program-linked-list-operations-menu/685736/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/singly-linked-list-in-c-c-program-linked-list-operations-menu/685736.png","ImageObject",300,407,{"name":92,"@type":93},"Emma Wilson","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-28","2026-11-07",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How does the program insert a node at the beginning?","Question",{"text":112,"@type":113},"It allocates a new node, takes the value from input, sets the new node’s next pointer to the current head, and updates head to the new node.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What options are available for deleting nodes?",{"text":117,"@type":113},"The menu supports deleting from the beginning, deleting the last node, and deleting the node after a specified location. Each delete function checks for an empty list and updates pointers accordingly.",{"name":119,"@type":110,"acceptedAnswer":120},"How does searching work in the linked list?",{"text":121,"@type":113},"The program traverses the list from head, compares each node’s data with the target value, and prints the 1-based location if found; otherwise it prints that the item is not found.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},685736,1794017213,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":41,"preview_page_count":14,"preview_urls":144},3848291630094,"https://eur-avatar.wpscdn.com/davatar_085a072bc5b1113ac321206ff7593b45","Singly Linked List in C.  \n\\#include\u003Cstdio.h>  \n\\#include\u003Cstdlib.h> struct node  \n{  \nint data;  \nstruct node *next;};  \nstruct node *head;  \nvoid beginsert ();  \nvoid lastinsert ();  \nvoid randominsert();  \nvoid begin_delete();  \nvoid last_delete();  \nvoid random_delete();  \nvoid display();  \nvoid search();  \nvoid main ()  \n{  \nint choice =0;  \nwhile(choice != 9)  \n{  \nprintf(\"\\n\\n*********Main Menu*********\\n\");  \nprintf(\"\\nChoose one option from the following list ...\\n\");  \nprintf(\"\\n===============================================\\n\");  \nprintf(\"\\n1.Insert in begining\\n2.Insert at last\\n3.Insert at any random location\\n4.Delete from Beginning\\n5.Delete from last\\n6.Delete node after specified location\\n7.Search for an element\\n8.Show\\n9.Exit\\n\");  \nprintf(\"\\nEnter your choice?\\n\");  \nscanf(\"\\n%d\",&choice);  \nswitch(choice)  \n{  \ncase 1: beg_insert();  \nbreak;  \ncase 2: last_insert();  \nbreak;  \ncase 3: random_insert();  \nbreak;  \ncase 4: begin_delete();  \nbreak;  \ncase 5: last_delete();  \nbreak;  \ncase 6: random_delete();  \nbreak;  \ncase 7: search();  \nbreak;  \ncase 8: display();  \nbreak;  \ncase 9: exit(0);  \nbreak;  \ndefault: printf(\"Please enter valid choice..\");}  \n}  \n}  \nvoid beg_insert(){  \nstruct node *ptr;  \nint item;  \nptr = (struct node *) malloc(sizeof(struct node *)); if(ptr == NULL)  \n{  \nprintf(\"\\nOVERFLOW\");  \n} else {  \nprintf(\"\\nEnter value\\n\");  \nscanf(\"%d\",&item);  \nptr->data = item;  \nptr->next = head;  \nhead = ptr;  \nprintf(\"\\nNode inserted\");}  \n}  \nvoid last_insert(){  \nstruct node *ptr,*temp; int item;  \nptr = (struct node*)malloc(sizeof(struct node)); if(ptr == NULL)  \n{  \nprintf(\"\\nOVERFLOW\");  \n} else {  \nprintf(\"\\nEnter value?\\n\");  \nscanf(\"%d\",&item);  \nptr->data = item;  \nif(head == NULL)  \n{  \nptr-> next = NULL;  \nhead = ptr;  \nprintf(\"\\nNode inserted\");}  \nelse  \n{  \ntemp = head;  \nwhile (temp-> next != NULL)  \n{  \ntemp = temp-> next;  \n}  \ntemp->next = ptr;  \nptr->next = NULL;  \nprintf(\"\\nNode inserted\");  \n}  \n}  \n}  \nvoid random_insert(){  \nint i,loc,item;  \nstruct node *ptr, *temp;  \nptr = (struct node *) malloc (sizeof(struct node));  \nif(ptr == NULL){  \nprintf(\"\\nOVERFLOW\");  \n} else {  \nprintf(\"\\nEnter element value\");  \nscanf(\"%d\",&item);  \nptr->data = item;  \nprintf(\"\\nEnter the location after which you want to insert \"); scanf(\"\\n%d\",&loc);  \ntemp=head;  \nfor(i=0;i\u003Cloc;i++)  \n{  \ntemp = temp->next;  \nif(temp == NULL)  \n{  \nprintf(\"\\ncan't insert\\n\");  \nreturn;  \n}  \n}  \nptr->next = temp->next;  \ntemp->next = ptr;  \nprintf(\"\\nNode inserted\");}  \n}  \nvoid begin_delete(){  \nstruct node *ptr;  \nif(head == NULL){  \nprintf(\"\\nList is empty\\n\");  \n} else {  \nptr = head;  \nhead = ptr->next;  \nfree(ptr);  \nprintf(\"\\nNode deleted from the begining ...\\n\");}  \n}  \nvoid last_delete(){  \nstruct node *ptr,*ptr1;  \nif(head == NULL){  \nprintf(\"\\nlist is empty\");}  \nelse if(head-> next == NULL){  \nhead = NULL;  \nfree(head);  \nprintf(\"\\nOnly node of the list deleted ...\\n\");}  \nelse {  \nptr = head;  \nwhile(ptr->next != NULL)  \n{  \nptr1 = ptr;  \nptr = ptr->next;}  \nptr1->next = NULL;  \nfree(ptr);  \nprintf(\"\\nDeleted Node from the last ...\\n\");  \n}  \n}  \nvoid random_delete(){  \nstruct node *ptr,*ptr1;  \nint loc,i;  \nprintf(\"\\n Enter the location of the node after which you want to perform deletion \\n\"); scanf(\"%d\",&loc);  \nptr=head;  \nfor(i=0;i\u003Cloc;i++){  \nptr1 = ptr;  \nptr = ptr->next;  \nif(ptr == NULL)  \n{  \nprintf(\"\\nCan't delete\");  \nreturn;}  \n}  \nptr1->next = ptr->next;  \nfree(ptr);  \nprintf(\"\\nDeleted node %d \",loc+1);}  \nvoid search(){  \nstruct node *ptr;  \nint item,i=0,flag;  \nptr = head;  \nif(ptr == NULL){  \nprintf(\"\\nEmpty List\\n\");  \n} else {  \nprintf(\"\\nEnter item which you want to search?\\n\");  \nscanf(\"%d\",&item);  \nwhile (ptr!=NULL)  \n{  \nif(ptr->data == item)  \n{  \nprintf(\"item found at location %d \",i+1);  \nflag=0;  \n}  \nelse  \n{  \nflag=1;  \n}  \ni++;  \nptr = ptr-> next;}  \nif(flag==1)  \n{  \nprintf(\"Item not found\\n\");}  \n}  \n}  \nvoid display(){  \nstruct node *ptr; ptr = head;  \nif(ptr","cbCaiaMEo5Nfw8JM","https://ap.wps.com/l/cbCaiaMEo5Nfw8JM","pdf",51314,12,"English","# Main Menu\n## Insert operations\n## Delete operations\n## Search and display\n## Program flow (switch-case)","[{\"question\":\"How does the program insert a node at the beginning?\",\"answer\":\"It allocates a new node, takes the value from input, sets the new node’s next pointer to the current head, and updates head to the new node.\"},{\"question\":\"What options are available for deleting nodes?\",\"answer\":\"The menu supports deleting from the beginning, deleting the last node, and deleting the node after a specified location. Each delete function checks for an empty list and updates pointers accordingly.\"},{\"question\":\"How does searching work in the linked list?\",\"answer\":\"The program traverses the list from head, compares each node’s data with the target value, and prints the 1-based location if found; otherwise it prints that the item is not found.\"}]","Singly Linked List in C - C Program - Linked List Operations Menu | PDF",[145,149],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/77e90a050b26c725a5532b7a478b8847.webp",983,1272,{"page_no":14,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e802f3a2d557a30de8b8e06fb2a84d68.webp",982,1270,{"list":154,"token":66},[155,161,167,173,179,185,191,197,203,209],{"doc_id":156,"doc_title":157,"file_type":137,"home_preview_img_url":158,"slug":159,"view_count":19,"category_name":30,"create_tm":160},685767,"Implementation of Linked List - Lecture 7 - In C++","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000198089/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=clp4n6hdAiFqGu2O%2BBUdNi5ql0o%3D","implementation-of-linked-list-lecture-7-in-c",1794017950,{"doc_id":162,"doc_title":163,"file_type":137,"home_preview_img_url":164,"slug":165,"view_count":24,"category_name":30,"create_tm":166},685741,"ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY - Linked list implementation - Singly linked lists - Core algorithms for traversal, counting, searching and insertion","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000186201/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=vcCj5sEEmvH3hp9rqjMOsvumxjY%3D","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion",1794017223,{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":81,"category_name":30,"create_tm":172},732873,"Singly Linked Lists in C - Introduction and Traversal Example","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031413508/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=qpPnfwsRQCE6SQqdB4%2Fiyl1ghxk%3D","singly-linked-lists-in-c-introduction-and-traversal-example",1795382670,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":24,"category_name":30,"create_tm":178},685726,"L6b - Linked List Variations - Lecture 6b","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000185855/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=6kfJNZmPsnglAnL3qWSW5DkYy2g%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":24,"category_name":30,"create_tm":184},685762,"Linked List - Course 13004700 Part-2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999691129/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=3ZZO9jwG3lMM39bBmhNk8G3P8ho%3D","linked-list-course-13004700-part-2",1794017631,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":24,"category_name":30,"create_tm":190},685667,"Implementing Singly Linked List in C++ - struct and pointers","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000175839/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=0Uf%2BREfYTwVP%2BfJrVVea%2Fs1XVVw%3D","implementing-singly-linked-list-in-c-struct-and-pointers",1794016535,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":34,"category_name":30,"create_tm":196},685731,"Lecture Five - Linked List Structure","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999689386/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=sKXzaShhaf4YbEkTJ8EANqFuy9c%3D","lecture-five-linked-list-structure",1794017204,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":14,"category_name":30,"create_tm":202},719605,"Linked Lists - lecture notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023815899/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=VnhORlpLetIwu%2Btn796gnC1AQx4%3D","linked-lists-lecture-notes",1795006752,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":14,"category_name":30,"create_tm":208},719606,"Linked Lists - Data Structures and Algorithms in Java","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023515214/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=KLBTSkBP7QBnttjOszTeUDr2N8w%3D","linked-lists-data-structures-and-algorithms-in-java",1795006758,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":19,"category_name":30,"create_tm":178},685727,"Circular Linked Lists - All Operations and Complexity Analysis","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000185859/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=HwMuaceGXDea45RDNGQrd%2BMrEK4%3D","circular-linked-lists-all-operations-and-complexity-analysis"]