[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685730-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-685730-en":130,"doc-similar-685730":180},{"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":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","chapter-4-linked-lists-41-singly-linked-lists-or-chains","Chapter 4 Linked Lists - 4.1 Singly Linked Lists Or Chains","","Chapter 4 explains linked lists as an alternative to array-based sequential mappings for representing simple data structures. It contrasts the fixed-distance storage of successive nodes in arrays, which allows O(1) access to an arbitrary node, with the disadvantage that insertion and deletion are costly due to required data movement. It introduces linked representation where each item can be placed anywhere in memory and each node contains a link to the next node, making arbitrary insertions and deletions easier. The chapter further describes memory layout examples, normal drawing conventions using a firstNode pointer, null termination, and basic traversal logic for operations like get(0) and get(1) using index checks and next pointers.",{"@graph":14,"@context":73},[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/chapter-4-linked-lists-41-singly-linked-lists-or-chains/685730/",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/chapter-4-linked-lists-41-singly-linked-lists-or-chains/685730.png","ImageObject",300,407,{"name":42,"@type":43},"WHO AM I","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-30","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"Why do arrays make insertion and deletion of arbitrary elements expensive?","Question",{"text":63,"@type":64},"Arrays require data movement because elements are stored at fixed distance apart in sequential memory. Inserting or deleting an element forces shifting neighboring elements to preserve order.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does a singly linked list represent a sequence in memory?",{"text":68,"@type":64},"Each node stores data plus exactly one pointer (link) to the next node. Nodes can be placed anywhere in memory, and the last node’s pointer is null to end the chain.",{"name":70,"@type":61,"acceptedAnswer":71},"How does the get(0) or get(1) operation reach the desired node?",{"text":72,"@type":64},"Starting from firstNode, the method checks the index (checkIndex(i)) and then follows next pointers: get(0) returns the first node directly, while get(1) moves to the next node from firstNode.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},685730,1794017203,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":55,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":115,"preview_urls":145},10857686687108,"https://eur-avatar.wpscdn.com/avatar/9e0008edd84b319fe0c?x-oss-process=image/resize,m_fixed,w_180,h_180&k=1794290847020028784","Chapter 4 Linked Lists  \n4.1 Singly Linked lists Or Chains  \nThe representation of simple data structure using an array and a sequential mapping has the property:  \n􀀡 Successive nodes of the data object are stored at fixed distance apart.  \n􀀡 This makes it easy to access an arbitrary node in O(1).  \n1  \nDisadvantage of sequential mapping:  \nIt makes insertion and deletion of arbitrary elements expensive.  \nFor example:  \nInsert “GAT” into or delete “LAT” from  \n(BAT, CAT, EAT, FAT, HAT, JAT, LAT, MAT, OAT, PAT, RAT,  \nSAT, TAT,VAT,WAT)  \nneed data movement.  \nSolution---linked representation:  \nitems of a list may be placed anywhere in the memory.  \nAssociated with each item is a point (link) to the next item.  \n2  \nfirst  \n\n| |  |\n| --- | --- |\n| BAT |  |\n\n\n| CAT |  |\n| --- | --- |\n\n\n| EAT |  |\n| --- | --- |\n\n| WAT | 0 |\n| --- | --- |\n\nIn linked list, insertion (deletion) of arbitrary elements is much easier:  \nfirst  \n\n| BAT |  |\n| --- | --- |\n\n …  FAT  ~~ / ~~ HAT    \nx   \n\n| GAT |  |\n| --- | --- |\n\n…  \n3  \nThe above structures are called singly linked lists or chains in which each node has exactly one pointer field.  \n• list elements are stored, in  \nmemory, in an arbitrary order  \n• explicit information (called a  \nlink) is used to go from one element to the next  \n4  \nMemory Layout  \nLayout of L = (a,b,c,d,e) using an array representa9on .  \n\n| a | b | c | d | e |  |  |  |  |  |  |  |  |  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n\nA linked representation uses an arbitrary layout.  \n\n| c |  |  |  | a |  |  |  | e |  |  | d |  |  | b |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n\n Linked Representa9on   \n\n|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  |  |  |  |  | |  |  |  |  |  |  |  |  |  |  |  |  |\n| c |  |  |  |  | a |  |  |  |  | e |  |  | d |  |  |  | b |  |\n| |  | |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n\nfirstNode  \npointer (or link) in e is null  \nuse a variable firstNode to get to the first element a  \nNormal Way To Draw A Linked List  \nfirstNode  \n|  | |  | |  | |  | | null |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  |  |  |  |  |  |  |  |\n| a |  | b |  | c |  | d |  | e |\n\n link or pointer ﬁeld of node  \ndata field of node  \n Chain   \nfirstNode  \n| | | | | | | | |  null  |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  |  |  |  |  |  |  |  |\n| a |  | b |  | c |  | d |  | e |\n\n•A chain is a linked list in which each node represents one element.  \n• There is a link or pointer from one element to the next.  \n• The last node has a null pointer .  \nget(0)  \nfirstNode  \n|  |\n| --- |\n| a |\n\n\n|  |\n| --- |\n| b |\n\n\n|  | |  | |  |\n| --- | --- | --- | --- | --- |\n|  |  |  |  |  |\n| c |  | d |  | e |\n\nnull  \ncheckIndex(0);  \ndesiredNode = ﬁrstNode; // gets you to ﬁrst node return desiredNode 􀀢element;  \nget(1)  \nfirstNode  \n|  |\n| --- |\n| a |\n\n\n|  |\n| --- |\n| b |\n\n\n|  | |  | |  |\n| --- | --- | --- | --- | --- |\n|  |  |  |  |  |\n| c |  | d |  | e |\n\nnull  \ncheckIndex(1);  \ndesiredNode = ﬁrstNode 􀀢 next; // gets you to second node return desiredNode 􀀢 element;","cbCaimDuA7PECd6G","https://ap.wps.com/l/cbCaimDuA7PECd6G","pdf",445898,81,"English","# Chapter 4 Linked Lists\n## 4.1 Singly Linked lists Or Chains\n## Representation Trade-offs: Arrays vs Linked Representation\n## Memory Layout and Linked Representation\n## Drawing a Singly Linked List (firstNode, pointer/link, null)\n## Traversal for get(i) Using next Pointers","[{\"question\":\"Why do arrays make insertion and deletion of arbitrary elements expensive?\",\"answer\":\"Arrays require data movement because elements are stored at fixed distance apart in sequential memory. Inserting or deleting an element forces shifting neighboring elements to preserve order.\"},{\"question\":\"How does a singly linked list represent a sequence in memory?\",\"answer\":\"Each node stores data plus exactly one pointer (link) to the next node. Nodes can be placed anywhere in memory, and the last node’s pointer is null to end the chain.\"},{\"question\":\"How does the get(0) or get(1) operation reach the desired node?\",\"answer\":\"Starting from firstNode, the method checks the index (checkIndex(i)) and then follows next pointers: get(0) returns the first node directly, while get(1) moves to the next node from firstNode.\"}]","Chapter 4 Linked Lists - 4.1 Singly Linked Lists Or Chains | PDF",204,[146,150,154,158,162,165,169,173,177],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/9159be51c33f4274a982de98dec2b73b.webp",983,737,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/030f6803476312dc1bbb64e5ab2db5bf.webp",982,736,{"page_no":30,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/f26f95a49a6da7abc556e9f91dfb1cff.webp",981,735,{"page_no":33,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/182dadd2d1c098fda259135cd4d20471.webp",980,734,{"page_no":55,"url":163,"width":164,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a052273d292565ced9c1b70e08f97559.webp",979,{"page_no":101,"url":166,"width":167,"height":168},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/ab2b644595487f6a97c4f61b8c84422d.webp",978,733,{"page_no":105,"url":170,"width":171,"height":172},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/70c49192ced2e2fcd540b9ecfcfbfba1.webp",977,732,{"page_no":110,"url":174,"width":175,"height":176},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/22be24857245a22cea775efebc991c25.webp",976,731,{"page_no":115,"url":178,"width":179,"height":176},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/ab36c6eebcd4aa216ef9f4e0dacb2501.webp",975,{"list":181,"token":11},[182,188,194,200,206,212,218,224,230,236],{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":101,"category_name":29,"create_tm":187},685766,"Linked Lists - Fundamentals - Core Concepts and C++ Implementation Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000198068/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=t2rU2WjCLbHWepkXR50wFy%2FUlek%3D","linked-lists-fundamentals-core-concepts-and-c-implementation-notes",1794017949,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":55,"category_name":29,"create_tm":193},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=1796111279&Signature=gv7RnjQA3vGAdwb%2FFWzq3dSTmcg%3D","linked-lists-introduction-properties-advantages-disadvantages-and-types",1794016969,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":105,"category_name":29,"create_tm":199},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=1796111279&Signature=NUPXWk%2BsaCHf8rPmqb3FrsunesQ%3D","lecture-five-linked-list-structure",1794017204,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":55,"category_name":29,"create_tm":205},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=1796111279&Signature=232W9CUUJoULHftIdvfUEYJpohU%3D","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion",1794017223,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":55,"category_name":29,"create_tm":211},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=1796111279&Signature=0OP8tmzMFAi8xVBXDGMRpnNutLo%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":30,"category_name":29,"create_tm":217},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=1796111279&Signature=TdQi5Gp1KO1mPRPIhSX1%2FiGI1kM%3D","singly-linked-lists-in-c-introduction-and-traversal-example",1795382670,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":30,"category_name":29,"create_tm":223},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=1796111279&Signature=g0pHOOIRA%2FfCFGdNwn0wgMMUupU%3D","unit11-linked-lists",1795382671,{"doc_id":225,"doc_title":226,"file_type":137,"home_preview_img_url":227,"slug":228,"view_count":30,"category_name":29,"create_tm":229},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=1796111279&Signature=8BTcENorexSvJfasZqk1rmRRrQk%3D","chapter-15-linked-data-structures-java-linked-lists-key-concepts",1795006731,{"doc_id":231,"doc_title":232,"file_type":137,"home_preview_img_url":233,"slug":234,"view_count":33,"category_name":29,"create_tm":235},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=1796111279&Signature=8utzDubYEZAjMAT3xR0EsUwqIZY%3D","lecture-17-linked-list-data-structure-part-ii-double-linked-list-applications-and-insertion",1795006749,{"doc_id":237,"doc_title":238,"file_type":137,"home_preview_img_url":239,"slug":240,"view_count":55,"category_name":29,"create_tm":241},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=1796111279&Signature=bpzP%2F99w8Mdn89587zil8pyLAGM%3D","implementing-singly-linked-list-in-c-struct-and-pointers",1794016535]