[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685741-105":3,"detail-sidebar-cat-0-en-105":85,"doc-detail-685741-en":134,"doc-similar-685741":157},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":78,"head_meta":80,"extra_data":82,"updated_unix":84},105,"en","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion","ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY - Linked list implementation - Singly linked lists - Core algorithms for traversal, counting, searching and insertion","","ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY material explains singly linked lists, contrasting arrays and linked lists in memory layout and access method. It details traversal using START and PTR pointers, including an algorithmic loop that processes nodes until NULL. The content also presents node counting by incrementing a counter during traversal, and searching by comparing each node’s DATA with a target value, returning the node’s address or NULL. Finally, it outlines insertion into a list, covering cases for beginning, end, and before/after a given node, with overflow handling when no free memory exists.",{"@graph":14,"@context":77},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion/685741/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion/685741.png","ImageObject",300,407,{"name":42,"@type":43},"Ivy","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-22","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69,73],{"name":60,"@type":61,"acceptedAnswer":62},"What is a singly linked list and how are nodes connected?","Question",{"text":63,"@type":64},"A singly linked list stores data in each node and includes a pointer to the next node of the same data type. The last node marks the end using NULL (or -1) in the NEXT field.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does traversal of a singly linked list work using START and PTR?",{"text":68,"@type":64},"Traversal starts by setting PTR to the address stored in START. A while loop continues processing nodes until PTR encounters NULL, then processing is applied to the current node and PTR moves to the NEXT node.",{"name":70,"@type":61,"acceptedAnswer":71},"How is searching performed in a linked list for a target value (VAL)?",{"text":72,"@type":64},"Searching compares each node’s DATA with VAL inside a while loop. If VAL is found, the address of that node is stored in POS; otherwise POS is set to NULL to indicate the value is not present.",{"name":74,"@type":61,"acceptedAnswer":75},"What insertion cases are covered when inserting a new node into a linked list?",{"text":76,"@type":64},"Insertion is described through four cases: inserting at the beginning, at the end, after a given node, and before a given node. The material also includes overflow handling when no free memory cell is available (e.g., AVAIL = NULL).","https://schema.org",{"og:url":32,"og:type":79,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":81,"canonical":32},"index,follow",{"doc_id":83,"site_id":7},685741,1794017223,{"code":4,"msg":86,"data":87},"success",[88,92,96,100,104,108,113,118,123,126,130],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":101,"show_sort_weight":102,"slug":103},"Comic",60,"comic",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":106,"slug":107},6,50,"technology",{"id":109,"doc_module":4,"doc_module_name":25,"category_name":110,"show_sort_weight":111,"slug":112},7,"Healthcare",40,"healthcare",{"id":114,"doc_module":4,"doc_module_name":25,"category_name":115,"show_sort_weight":116,"slug":117},8,"Research & Report",30,"research-report",{"id":119,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":121,"slug":122},9,"Religion & Spirituality",20,"religion-spirituality",{"id":121,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":121,"slug":125},"World Cup","world-cup",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":127,"slug":129},10,"Lifestyle","lifestyle",{"id":131,"doc_module":4,"doc_module_name":25,"category_name":132,"show_sort_weight":55,"slug":133},19,"General","general",{"code":4,"msg":86,"data":135},{"doc_id":83,"user_id":136,"nickname":42,"user_avatar":137,"doc_module":4,"category_id":105,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":138,"file_id":139,"file_url":140,"file_type":141,"file_size":142,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":143,"language":144,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":12,"update_tm":84,"read_time":116,"preview_page_count":26,"preview_urls":148},549758252649,"https://ap-avatar.wpscdn.com/avatar/8000253669c5317157?_k=1778319167496531819","ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY  \nLinked list implementation – Singly linked lists  \nLinked Lists Versus Arrays  \nArrays and linked lists are a linear collection of data elements  \n| Array | Linked Lists |\n| --- | --- |\n| It stores its nodes in consecutive memory locations | It does not store its nodes in consecutive memory locations |\n| It allows random access of data | It does not allow random access of data. Nodes in a linked list can be accessed only in a sequential manner |\n| It cannot add any number of elements in the array | It can add any number of elements in the list |\n\nSINGLY LINKED LISTS  \nDefinition  \nA singly linked list is the simplest type of linked list in which every node contains some data and a pointer to the next  \nnode of the same data type. By saying that the node contains a pointer to the next node, we mean that the node  \nstores the address of the next node in sequence. A singly linked list allows traversal of data only in one way  \nTraversing a Linked List  \nAccessing the nodes of the list in order to perform some processing on them. Remember a linked list always contains a pointer variable START which stores the address of the first node of the list. End of the list is marked by storing  \nNULL or –1 in the NEXT field of the last node. For traversing the linked list, we also make use of another pointer variable PTR which points to the node that is currently being accessed.  \nROHINI COLLEGE OF ENGINEERING & TECHNOLOGY  \nAlgorithm for traversing a linked list  \n􀁸 In this algorithm, we first initialize PTR with the address of START. So now, PTR points to the first node of the linked list.  \n􀁸 Then in Step 2, a while loop is executed which is repeated till PTR processes the last node, that is until it encounters NULL.  \n􀁸 In Step 3, we apply the process (e.g., print) to the current node, that is, the node pointed by PTR.  \n􀁸 In Step 4, we move to the next node by making the PTR variable point to the node whose address is stored in the NEXT field.  \nAlgorithm to print the number of nodes in a linked list  \nWe will traverse each and every node of the list and while traversing every individual node, we will increment the  \ncounter by 1. Once we reach NULL, that is, when all the nodes of the linked list have been traversed, the final value of the counter will be displayed.  \nSearching for a Value in a Linked List  \nSearching a linked list means finding whether a given value is present in the information part of the node or not. If it is present, the algorithm returns the address of the node that contains the value.  \nROHINI COLLEGE OF ENGINEERING & TECHNOLOGY  \n􀁸 In Step 1, we initialize the pointer variable PTR with START that contains the address of the first node.  \n􀁸 In Step 2, a while loop is executed which will compare every node’s DATA with VAL for which the search is being made.  \n􀁸 If the search is successful, that is, VAL has been found, then the address of that node is stored in POS and the control jumps to the last statement of the algorithm.  \n􀁸 However, if the search is unsuccessful, POS is set to NULL which indicates that VAL is not present in the linked list.  \nExample: Illustration of Searching algorithm  \nConsider the linked list shown in Figure. If we have VAL = 4, then the flow of the algorithm can be explained as  \nshown in the figure.  \nROHINI COLLEGE OF ENGINEERING & TECHNOLOGY  \nInserting a New Node in a Linked List  \nHow a new node is added into an already existing linked list? We will take four cases and then see how  \ninsertion is done in each case.  \nCase 1: The new node is inserted at the beginning.  \nCase 2: The new node is inserted at the end.  \nCase 3: The new node is inserted after a given node.  \nCase 4: The new node is inserted before a given node. OVERFLOW  \nOverflow is a condition that occurs when AVAIL = NULL or no free memory cell is present in the system. When  \nthis condition occurs, the program must give an appropriate message.  \nCase 1: Inserting a Node at","cbCait6z3w5XY3AX","https://ap.wps.com/l/cbCait6z3w5XY3AX","pdf",791240,12,"English","# Linked Lists Versus Arrays\n## SINGLY LINKED LISTS\n# Traversing a Linked List\n## Algorithm for traversing a linked list\n# Printing the Number of Nodes in a Linked List\n## Counting algorithm\n# Searching for a Value in a Linked List\n## Search algorithm and example\n# Inserting a New Node in a Linked List\n## Four insertion cases\n## Overflow handling\n## Inserting at the beginning\n## Inserting at the end\n## Inserting after a given node","[{\"question\":\"What is a singly linked list and how are nodes connected?\",\"answer\":\"A singly linked list stores data in each node and includes a pointer to the next node of the same data type. The last node marks the end using NULL (or -1) in the NEXT field.\"},{\"question\":\"How does traversal of a singly linked list work using START and PTR?\",\"answer\":\"Traversal starts by setting PTR to the address stored in START. A while loop continues processing nodes until PTR encounters NULL, then processing is applied to the current node and PTR moves to the NEXT node.\"},{\"question\":\"How is searching performed in a linked list for a target value (VAL)?\",\"answer\":\"Searching compares each node’s DATA with VAL inside a while loop. If VAL is found, the address of that node is stored in POS; otherwise POS is set to NULL to indicate the value is not present.\"},{\"question\":\"What insertion cases are covered when inserting a new node into a linked list?\",\"answer\":\"Insertion is described through four cases: inserting at the beginning, at the end, after a given node, and before a given node. The material also includes overflow handling when no free memory cell is available (e.g., AVAIL = NULL).\"}]","ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY - Linked list implementation - Singly linked lists - Core algorithms for traversal, counting, searching and insertion | PDF",[149,153],{"page_no":22,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/f0aeff287e3f2ff76e9f421acf1c4905.webp",983,1389,{"page_no":26,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a27abd0215fecfa15fa49179c00b4325.webp",982,1388,{"list":158,"token":11},[159,165,171,177,183,189,195,201,207,212],{"doc_id":160,"doc_title":161,"file_type":141,"home_preview_img_url":162,"slug":163,"view_count":109,"category_name":29,"create_tm":164},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=1796207219&Signature=qr4CiudlsplfYsu2YLGaQswldCc%3D","lecture-five-linked-list-structure",1794017204,{"doc_id":166,"doc_title":167,"file_type":141,"home_preview_img_url":168,"slug":169,"view_count":55,"category_name":29,"create_tm":170},685716,"Linked Lists - Introduction - Properties, Advantages, Disadvantages, and Types","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999688533/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=VRPrvQHFcSU5cCC3fc9ebD7LHUw%3D","linked-lists-introduction-properties-advantages-disadvantages-and-types",1794016969,{"doc_id":172,"doc_title":173,"file_type":141,"home_preview_img_url":174,"slug":175,"view_count":109,"category_name":29,"create_tm":176},685760,"CS62 Class 8 - Linked lists - Basic Data Structures","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000192614/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=gRkaDFtiq5SBnw9%2B22Uj%2FdErgWw%3D","cs62-class-8-linked-lists-basic-data-structures",1794017629,{"doc_id":178,"doc_title":179,"file_type":141,"home_preview_img_url":180,"slug":181,"view_count":55,"category_name":29,"create_tm":182},685730,"Chapter 4 Linked Lists - 4.1 Singly Linked Lists Or Chains","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000185878/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=rPm3p65ASZqAn67ucSwjUcPm8L4%3D","chapter-4-linked-lists-41-singly-linked-lists-or-chains",1794017203,{"doc_id":184,"doc_title":185,"file_type":141,"home_preview_img_url":186,"slug":187,"view_count":33,"category_name":29,"create_tm":188},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=1796207219&Signature=PoKGe18nB3o2pXAObBqxdhhko6E%3D","circular-linked-lists-all-operations-and-complexity-analysis",1794017196,{"doc_id":190,"doc_title":191,"file_type":141,"home_preview_img_url":192,"slug":193,"view_count":30,"category_name":29,"create_tm":194},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=1796207219&Signature=qCrxWOHsjR6Yooo9gXQSMQ9Hulw%3D","singly-linked-lists-in-c-introduction-and-traversal-example",1795382670,{"doc_id":196,"doc_title":197,"file_type":141,"home_preview_img_url":198,"slug":199,"view_count":30,"category_name":29,"create_tm":200},719597,"Chapter 15 - Linked Data Structures - Java Linked Lists - Key Concepts","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023815525/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=a%2FlqIJZwym6YiP0hfP7HNYzWGpA%3D","chapter-15-linked-data-structures-java-linked-lists-key-concepts",1795006731,{"doc_id":202,"doc_title":203,"file_type":141,"home_preview_img_url":204,"slug":205,"view_count":30,"category_name":29,"create_tm":206},732874,"Unit11-Linked Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031780339/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=zgmXj%2F4D6p9ooauo1EGwzIp1PVs%3D","unit11-linked-lists",1795382671,{"doc_id":208,"doc_title":209,"file_type":141,"home_preview_img_url":210,"slug":211,"view_count":55,"category_name":29,"create_tm":188},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=1796207219&Signature=UGL6Vm%2BoHW%2Bkt3ZfM2omnCg16MQ%3D","l6b-linked-list-variations-lecture-6b",{"doc_id":213,"doc_title":214,"file_type":141,"home_preview_img_url":215,"slug":216,"view_count":33,"category_name":29,"create_tm":217},719604,"Lecture 17 - Linked List Data Structure (Part-II) - Double Linked List - Applications and Insertion","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023515168/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796207219&Signature=XsbESCsI31p%2BtWbXaXU43ly%2F2I0%3D","lecture-17-linked-list-data-structure-part-ii-double-linked-list-applications-and-insertion",1795006749]