[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685760-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-685760-en":130,"doc-similar-685760":164},{"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","cs62-class-8-linked-lists-basic-data-structures","CS62 Class 8 - Linked lists - Basic Data Structures","","CS62 Class 8 learning material explains linked lists as dynamic linear data structures using pointers/links/references rather than contiguous memory. It contrasts linked data structures with sequential data structures, illustrating how elements may reside in different memory locations. The notes define singly linked lists recursively (null or a node with a reference to the next list) and describe the memory concept of head/beginning. It also provides a recursive definition for doubly linked lists and distinguishes them by the presence of both next and prev pointers, along with head and tail, plus example walkthrough setup for an empty SLL and adding elements.",{"@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/cs62-class-8-linked-lists-basic-data-structures/685760/",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/cs62-class-8-linked-lists-basic-data-structures/685760.png","ImageObject",300,407,{"name":42,"@type":43},"Aria Callaghan","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-19","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",7,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is the main idea of linked lists compared to sequential data structures?","Question",{"text":63,"@type":64},"Linked lists use pointers/links/references to connect objects, so elements can be stored in different memory locations. With sequential structures, elements are typically laid out contiguously.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How is a singly linked list defined recursively?",{"text":68,"@type":64},"A singly linked list is either empty (null) or a node that holds a reference to another singly linked list. The node also contains the data element.",{"name":70,"@type":61,"acceptedAnswer":71},"What distinguishes a doubly linked list from a singly linked list?",{"text":72,"@type":64},"A doubly linked list has both next and prev references, and therefore maintains a head and a tail. A singly linked list only tracks a next pointer and a head.","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},685760,1794017629,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,105,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":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":103,"slug":104},6,50,"technology",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},"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":97,"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":102,"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":97,"preview_urls":145},962084926284,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","CS62 Class 8: Linked lists  \nBasic Data Structures  \n[https://www.geeksforgeeks.org/introduction-to-singly-linked-list/](https://www.geeksforgeeks.org/introduction-to-singly-linked-list/)  \n[https://www.geeksforgeeks.org/doubly-linked-list/](https://www.geeksforgeeks.org/doubly-linked-list/)  \nLinked Lists (conceptually)  \nLinked Lists  \n• Dynamic linear data structures .  \n• In contrast to sequential data structures, linked data structures use pointers/links/ references from one object to another .  \n• For example, the list of elements CS, ?, ! could be in very diﬀerent memory locations. We just need a pointer to the head and links to subsequent elements to reconstruct it.  \nHow it is in memory:  \nHead/Beginning/Front/First  \n|  | ? |  | CS |  |  |  | ! |  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n\n0 1 2 3 4 5 6 7  \nWhat the user’s mental model is:  \n\n| CS | ? |  | ! |\n| --- | --- | --- | --- |\n\n0 1 2  \nRecursive Definition of Singly Linked Lists  \n• A singly linked list is either empty (null) or a node having a reference to a singly linked list.  \n• Node: is a data type that holds elements of the same type and a reference to a next node .  \nhead  \n| element |  |\n| --- | --- |\n\n| element |  |\n| --- | --- |\n\n| element |  |\n| --- | --- |\n\n| element |  |\n| --- | --- |\n\nNode  \n\n| element |  |\n| --- | --- |\n\nRecursive Definition of Doubly Linked Lists  \n• A doubly linked list is either empty (null) or a node having a reference to a doubly linked list.  \n• Node: is a data type that holds any kind of data and two references to the previous and next node.  \nNode  \nhead tail  \n|  | element |  |\n| --- | --- | --- |\n\n| | element | |  |  | element |  |  |  | element | |  |  | element | |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  |  | |  |  |  | |  |  |  | |  |  |  |\n\nInformal summary of singly & doubly linked lists  \n• Singly linked lists only have a “next” pointer, and a head  \n• add() and remove() happen at the head  \n• Double linked lists have both a “prev” and “next” pointer, and a head and a tail  \nNode (single)  \nprivate class  \nE element;  \nNode next;}  \nNode {  \nNode  \n\n| element |  |\n| --- | --- |\n\nNode (double)  \nprivate class  \nE element;  \nNode next;  \nNode prev;}  \nNode {  \nNode  \n\n|  | element |  |\n| --- | --- | --- |\n\nSingly linked list  \nwalkthrough  \nSinglyLinkedList() : Constructs an empty SLL  \nhead = ?  \nsize = ?  \nWhat should happen?  \nSinglyLinkedList\u003CString> sll = new SinglyLinkedList\u003CString>();  \nSinglyLinkedList() : Constructs an empty SLL  \nSinglyLinkedList\u003CString> sll = new SinglyLinkedList\u003CString>();  \nhead = null size = 0  \nWhat should happen?  \nsll .add(“CS062”);","cbCaimTw3qn1Nssw","https://ap.wps.com/l/cbCaimTw3qn1Nssw","pdf",1268176,47,"English","# Linked Lists (conceptually)\n## How linked lists work in memory\n# Recursive definition of singly linked lists\n## Nodes and head reference\n# Recursive definition of doubly linked lists\n## Nodes with prev and next references\n# Informal comparison: singly vs doubly\n## Pointers, head/tail, and operations","[{\"question\":\"What is the main idea of linked lists compared to sequential data structures?\",\"answer\":\"Linked lists use pointers/links/references to connect objects, so elements can be stored in different memory locations. With sequential structures, elements are typically laid out contiguously.\"},{\"question\":\"How is a singly linked list defined recursively?\",\"answer\":\"A singly linked list is either empty (null) or a node that holds a reference to another singly linked list. The node also contains the data element.\"},{\"question\":\"What distinguishes a doubly linked list from a singly linked list?\",\"answer\":\"A doubly linked list has both next and prev references, and therefore maintains a head and a tail. A singly linked list only tracks a next pointer and a head.\"}]","CS62 Class 8 - Linked lists - Basic Data Structures | PDF",118,[146,150,153,157,160],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/161d21a9c89f0ebca4e4eca577118ce7.webp",983,552,{"page_no":26,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/0ca8f0dad884b86be2a6e2b452645502.webp",982,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/aa0bd3f09695041510b430ccccdb02cd.webp",981,551,{"page_no":33,"url":158,"width":159,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/bacff9bab5ab03221959cc76589ed61e.webp",980,{"page_no":97,"url":161,"width":162,"height":163},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/e41135ccd6786b637682752bd87d9cf4.webp",979,550,{"list":165,"token":11},[166,172,178,184,190,196,202,208,214,220],{"doc_id":167,"doc_title":168,"file_type":137,"home_preview_img_url":169,"slug":170,"view_count":55,"category_name":29,"create_tm":171},697943,"Lecture 12 Doubly Linked Lists - (with Recursion)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230009212198/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=KVdV5MXDLfSrtye0dPJJ2bjIPgg%3D","lecture-12-doubly-linked-lists-with-recursion",1794446071,{"doc_id":173,"doc_title":174,"file_type":137,"home_preview_img_url":175,"slug":176,"view_count":97,"category_name":29,"create_tm":177},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=1796111999&Signature=jK2tAKMHRckPrfhTux%2FhMvButgM%3D","linked-list-course-13004700-part-2",1794017631,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":55,"category_name":29,"create_tm":183},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=1796111999&Signature=6LBqbwvYA2WebmWgoN%2B%2Ff0P6jG8%3D","lecture-five-linked-list-structure",1794017204,{"doc_id":185,"doc_title":186,"file_type":137,"home_preview_img_url":187,"slug":188,"view_count":97,"category_name":29,"create_tm":189},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=1796111999&Signature=cyah91ewrAIZwwhrphvMUYq%2BYOg%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":97,"category_name":29,"create_tm":195},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=1796111999&Signature=evgUSj7gHf4miXp%2FzO9l47PWgYE%3D","linked-lists-introduction-properties-advantages-disadvantages-and-types",1794016969,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":26,"category_name":29,"create_tm":201},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=1796111999&Signature=A%2FUUm9qDHybuKosEzlvUFd5He78%3D","linked-lists-lecture-notes",1795006752,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":102,"category_name":29,"create_tm":207},685719,"Data Structures - Linked List - Unit 3","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000182441/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=Wyc3gKSOLTZQ3QB6Gj2UzVw30NA%3D","data-structures-linked-list-unit-3",1794016973,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":33,"category_name":29,"create_tm":213},685674,"Lecture 18 - Linked Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999686601/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=l5SfzzMEY619NU7EbLMgg4hInDI%3D","lecture-18-linked-lists",1794016551,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":97,"category_name":29,"create_tm":219},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=1796111999&Signature=ktM2vr7hT%2FWkz1uiWjOlNYs3%2BeM%3D","implementing-singly-linked-list-in-c-struct-and-pointers",1794016535,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":30,"category_name":29,"create_tm":225},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=1796111999&Signature=o1%2BByYLmdRttPkW4V%2B5hWZFj3Sw%3D","unit11-linked-lists",1795382671]