[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-719600-105":59,"doc-detail-719600-en":130,"doc-similar-719600":161},{"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","recitation-12-root-finding-sorting-stacks-queues-linked-lists-and-object-references","Recitation 12 - Root Finding, Sorting, Stacks, Queues - Linked Lists and Object References","","Study notes for Recitation 12 focused on core data-structure and algorithm topics: root finding, sorting, stacks, and queues, then a detailed walk-through of linked lists. The material introduces object references using a Node class, explaining that multiple references can point to a single object. It then defines linked lists as sequences of nodes containing an item and a next reference, shows traversal via following next links, discusses a simplified diagram model, and covers the SLinkedList design with first/last pointers and reusable manipulation methods. The notes conclude with advantages, disadvantages, and practical tips for handling special cases and drawing diagrams.",{"@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/recitation-12-root-finding-sorting-stacks-queues-linked-lists-and-object-references/719600/",{"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/recitation-12-root-finding-sorting-stacks-queues-linked-lists-and-object-references/719600.png","ImageObject",300,407,{"name":92,"@type":93},"Marglet","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-24","2026-11-18",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"How does object references work in the Node example?","Question",{"text":112,"@type":113},"The notes show that creating multiple references can point to a single Node object. Each reference “refers” to the same one object rather than creating new objects.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What is a linked list made of according to these notes?",{"text":117,"@type":113},"A linked list is a series of Nodes where each node holds an associated item object and a reference to the next node in the list.",{"name":119,"@type":110,"acceptedAnswer":120},"Why are linked lists useful, and what trade-offs do they have?",{"text":121,"@type":113},"Linked lists can grow dynamically and do not require contiguous memory, but they add overhead due to references and allow slower access than arrays, with potentially more complex maintenance code.","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},719600,1795006740,{"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":81,"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":144,"preview_page_count":19,"preview_urls":145},2336477982702,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Announcements  \n• FINAL EXAM Monday May 21, 1:30pm  \n• Review Session  \n– Wednesday May 16, 7-9pm  \nRecitation 12  \nRoot Finding, Sorting, Stacks, Queues  \nOutline  \n• Linked Lists  \n• Sorting  \n• Queues  \nObject References  \nLet’s start with a class called “Node”  \n[Node.java](Node.java)  \nclass Node{  \n}  \nTo create an instance of Node: n  \nNode n = new Node();  \nNode n2 = n;  \nThese are object references. Notice how there is only ONE object, and each reference“refers” to it.  \nFun with References  \nLet’s add to our Node class  \nNow, let’s use the following code:  \nNode n1 = new Node();  \nNode n2 = new Node(); [n2.next = n1](n2.next = n1) ;  \n[n1.next = n2](n1.next = n2) ;  \n[Node.java](Node.java)  \nclass Node{  \nNode next;}  \nnext   \nnext   \nLinked Lists  \n• A linked list is made of a series of Nodes, each with:  \n– an associated item object  \n– a reference to the next node of the list  \n• Simplified “double-box” picture:  \n\n|  |  | next\u003Cbr>|  |  | next\u003Cbr>|  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n\nnext  \n| |  |\n| --- | --- |\n| C |  |\n\n• Traverse the list by following each node’s “next”reference  \n7  \nSLinkedList  \nFor convenience, create a class with references to the first & last nodes, with methods, so we don’t have to rewrite the manipulation code each time.  \nOur original Node class  \n\n|  | public class SLinkedList implements List{\u003Cbr>private int length = 0;\u003Cbr>private Node first = null ;\u003Cbr>private Node last = null ;\u003Cbr>private static class Node {\u003Cbr>Object item;\u003Cbr>Node next;\u003Cbr>Node( Object o, Node n ){ item = o; next = n; }} |  |\n| --- | --- | --- |\n|  |  |  |\n|  | public\u003Cbr>public\u003Cbr>public\u003Cbr>public | int size() {/*code…*/}\u003Cbr>boolean isEmpty() {/*code…*/}\u003Cbr>boolean contains(Object o) {/*code…*/} void clear() {/*code…*/} |\n|  | // various add() and remove() methods…\u003Cbr>} |  |\n\nWhat’s so great about Linked Lists?  \nBIG Pros:  \n• A Linked List can grow dynamically.  \n(To resize an array you have to create a new, larger array, and copy everything over)  \n• A linked list does NOT need contiguous memory.  \n(A Java 1-D array has to occupy contiguous memory. When storing large amounts of data, finding back-to-back-to-back… memory can be impossible)  \nCons:  \n• The references add overhead.  \n• Access is slower than an array.  \n• The code to maintain a Linked List can be complex.  \n• Depending on how the ‘links’(references) are structured, you may only be able to traverse one way…  \nLinked List: Tips  \n• Always think of special cases  \n– What if your list is empty?  \n– What if there is only one element?  \n• Always draw a diagram! first last  \n|  |  | next\u003Cbr>|  |  | next\u003Cbr>|  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n\nnext","cbCairEAOp6HyNAT","https://ap.wps.com/l/cbCairEAOp6HyNAT","pdf",473212,21,"English","# Announcements\n# Recitation Topics\n## Object References\n## Linked Lists\n## SLinkedList Design\n## Linked Lists: Tips\n## Pros and Cons","[{\"question\":\"How does object references work in the Node example?\",\"answer\":\"The notes show that creating multiple references can point to a single Node object. Each reference “refers” to the same one object rather than creating new objects.\"},{\"question\":\"What is a linked list made of according to these notes?\",\"answer\":\"A linked list is a series of Nodes where each node holds an associated item object and a reference to the next node in the list.\"},{\"question\":\"Why are linked lists useful, and what trade-offs do they have?\",\"answer\":\"Linked lists can grow dynamically and do not require contiguous memory, but they add overhead due to references and allow slower access than arrays, with potentially more complex maintenance code.\"}]","Recitation 12 - Root Finding, Sorting, Stacks, Queues - Linked Lists and Object References | PDF",53,[146,150,153,157],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/eec239efc34c85f34cb61dcaa04631c6.webp",983,736,{"page_no":14,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/39c3a6acdf7814e996a9c2df1d03644a.webp",982,{"page_no":81,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/eaf7022e5fdcfd9f47fe94678ef0f577.webp",981,735,{"page_no":19,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/e84a20ecf8eeb956c21ef51517fbfe54.webp",980,734,{"list":162,"token":66},[163,169,175,181,187,193,199,205,211,217],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":14,"category_name":30,"create_tm":168},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=1796111879&Signature=%2Bz06ZGfUudPpAAEAJlV%2BIyWczPw%3D","linked-lists-lecture-notes",1795006752,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":24,"category_name":30,"create_tm":174},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=1796111879&Signature=Pie141mCkwol%2FKARsz61KNMFyps%3D","linked-lists-introduction-properties-advantages-disadvantages-and-types",1794016969,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":14,"category_name":30,"create_tm":180},719601,"Chapter 9 - Data Structures: Linked Lists - Objectives & Self-Referential Classes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023815831/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111879&Signature=iMUgssJL8%2FMQhYeK55YYw1MofaE%3D","chapter-9-data-structures-linked-lists-objectives-self-referential-classes",1795006745,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":19,"category_name":30,"create_tm":186},697936,"Lecture 11 - Doubly Linked Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010136454/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111879&Signature=bhQTsrLOHqb2GgLuXHV0CO%2FpXWg%3D","lecture-11-doubly-linked-lists",1794446060,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":44,"category_name":30,"create_tm":192},697948,"Data Structures Using Python - R20A0503 - Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010141008/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111879&Signature=I7OQL%2FLKkmyGfw5SoGJBf8VKzF0%3D","data-structures-using-python-r20a0503-lecture-notes",1794446274,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":24,"category_name":30,"create_tm":198},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=1796111879&Signature=6rJoXnvFrtMwU%2B1t%2Fv%2Bb3Of0xz4%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":34,"category_name":30,"create_tm":204},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=1796111879&Signature=STQLHcN%2BIK8%2FrJPuL16cLt1lrLc%3D","lecture-12-doubly-linked-lists-with-recursion",1794446071,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":24,"category_name":30,"create_tm":210},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=1796111879&Signature=J748IcHwtzXVfp%2B%2FrCBhAiSJWfs%3D","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion",1794017223,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":29,"category_name":30,"create_tm":216},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=1796111879&Signature=r4tGFceXtf%2FVCoIwxW3oEBqtbtI%3D","data-structures-linked-list-unit-3",1794016973,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":34,"category_name":30,"create_tm":222},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=1796111879&Signature=mug0bhHKKlGaTfxdI26yDNlj0IY%3D","cs62-class-8-linked-lists-basic-data-structures",1794017629]