[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-782751-105":59,"doc-detail-782751-en":129,"doc-similar-782751":159},{"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":122,"head_meta":124,"extra_data":126,"updated_unix":128},105,"en","linked-lists-and-recursion-lec-12-lecture-notes","Linked Lists and Recursion - LEC 12 - Lecture notes","","Linked lists and recursion are explained through traversal and modification of node chains. A list is defined recursively as either empty or a node containing data and another list, making the empty list a guaranteed base case. The lecture presents a public/private method pair for tracking the current sublist. Recursive modification returns the changed list and assigns it to curr.next or front, avoiding the need to stop one node early. The examples emphasize changes at the middle and front, while noting empty-list and end cases. Course announcements cover project deadlines, a new programming assignment, and quiz grades.",{"@graph":69,"@context":121},[70,84,104],{"@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/linked-lists-and-recursion-lec-12-lecture-notes/782751/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":98,"encodingFormat":97,"isAccessibleForFree":99,"interactionStatistic":100},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/linked-lists-and-recursion-lec-12-lecture-notes/782751.png","ImageObject",300,407,{"name":92,"@type":93},"EvelynWrites","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-12-03",true,{"@type":101,"interactionType":102,"userInteractionCount":14},"InteractionCounter",{"@type":103},"ViewAction",{"@type":105,"mainEntity":106},"FAQPage",[107,113,117],{"name":108,"@type":109,"acceptedAnswer":110},"How is a linked list defined recursively?","Question",{"text":111,"@type":112},"It is either empty or a node containing data and another linked list.","Answer",{"name":114,"@type":109,"acceptedAnswer":115},"What is the base case for recursive traversal?",{"text":116,"@type":112},"The empty list is the guaranteed base case, because its result is immediately known.",{"name":118,"@type":109,"acceptedAnswer":119},"How does recursive modification update a linked list?",{"text":120,"@type":112},"The method returns the changed list, which is assigned to curr.next or front. This lets the solution make changes without stopping one node early.","https://schema.org",{"og:url":83,"og:type":123,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":125,"canonical":83},"index,follow",{"doc_id":127,"site_id":62},782751,1796313797,{"code":4,"msg":5,"data":130},{"doc_id":127,"user_id":131,"nickname":92,"user_avatar":132,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":133,"file_id":134,"file_url":135,"file_type":136,"file_size":137,"view_count":14,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":138,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":128,"read_time":143,"preview_page_count":19,"preview_urls":144},687212989558,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","LEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nL E C 1 2  \nCSE 123  \nLinked Lists with Recursion  \nQuestions during Class? Raise hand or send here [sli.do \\#cse123A](sli.do #cse123A)  \n\n| BEFORE WE START\u003Cbr>Talk to your neighbors:\u003Cbr>Best boba in Seattle? |  |  |  |  |\n| --- | --- | --- | --- | --- |\n| Instructors: Nathan Brunelle |  |  |  |  |\n| Arohan\u003Cbr>TAs: Ido\u003Cbr>Hayden\u003Cbr>Srihari Kuhu Ziao Prakshi\u003Cbr>Niyati | Ashar\u003Cbr>Zachary\u003Cbr>Caleb\u003Cbr>Benoit\u003Cbr>Kavya\u003Cbr>Kieran\u003Cbr>Packard\u003Cbr>Trien | Neha\u003Cbr>Sebastian\u003Cbr>Justin\u003Cbr>Derek\u003Cbr>Cynthia\u003Cbr>Marcus\u003Cbr>Cora\u003Cbr>Lawrence | Rohini\u003Cbr>Joshua\u003Cbr>Heon\u003Cbr>Chris\u003Cbr>Shreya\u003Cbr>Crystal\u003Cbr>Dixon\u003Cbr>Evan | Rushil\u003Cbr>Sean\u003Cbr>Rashad\u003Cbr>Bhaumik\u003Cbr>Ashley\u003Cbr>Eeshani\u003Cbr>Nichole\u003Cbr>Cady |\n\nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nLecture Outline  \n• Announcements   \n• Traversing Linked Lists Recursively  \n• Modifying Linked Lists Recursively  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nAnnouncements  \n• Creative Project 2 due tonight May 14 at 11:59pm  \n• Resubmission Cycle 4 is due Fri (May 16) at 11:59pm  \n-  C1, P1 eligible  \n• Programming Assignment 2 released tomorrow (May 15)  \n- Focused on exhaustive search + recursive backtracking!  \n• Quiz 1 grades out early next week  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nLecture Outline  \n• Announcements  \n• Traversing Linked Lists Recursively   \n• Modifying Linked Lists Recursively  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nLinked Lists  \n• A linked list is either:  \nnull  \nEmpty list  \ndata next  \n\n| 4 |  |\n| --- | --- |\n\n another list  \nNode w/ another linked list  \nThis is a recursive definition! A list is either empty or a node with another list!  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nRecursive Traversals w/ LinkedLists  \n• Guaranteed base case: empty list  \n- Simplest possible input, should immediately know the return  \n• Guaranteed public / private pair  \n- Need to know which sublist you’re currently processing (i.e. curr)  \nmethod(one)   \nmethod(two)   \nmethod(three)   \nmethod(null)   \nfront  \n| 1 |  |\n| --- | --- |\n\n2   \n| 3 |  |\n| --- | --- |\n\nnull  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nLecture Outline  \n• Announcements  \n• Traversing Linked Lists Recursively  \n• Modifying Linked Lists Recursively   \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nModifying LinkedLists [Review]  \n• Remember: using a curr variable to iterate over nodes  \n• Does changing curr actually update our chain?  \n- [What will? Changing](What will? Changing curr.next)[ curr](What will? Changing curr.next)[.next](What will? Changing curr.next), changing front  \n- Need to stop one early to make changes  \n• Often a number of cases to watch out for:  \n- M(iddle)– Modifying node in the middle of the list (general)  \n- F(ront)– Modifying the first node  \n- E(mpty)– What if the list is empty?  \n- E(nd)– Rare, do we need to do something with the end of the list?  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nModifying LinkedLists Recursively  \n• Much easier than iterative solutions!  \n• No longer need to stop one early  \n- Can go right to the point you’d like to make the change  \nmethod(one)   method(two)   \nmethod(three)   \nmethod(null)   \nfront  \n| 1 |  |\n| --- | --- |\n\n2   \n| 3 |  |\n| --- | --- |\n\nnull  \nLEC 12: Linked Lists and Recursion CSE 123 Spring 2025  \nModifying LinkedLists Recursively  \n• Much easier than iterative solutions!  \n• No longer need to stop one early  \n- Can go right to the point you’d like to make the change  \n• How? Return the updated change and catch it!  \n- Private pair returns ListNode type  \n- [curr.next = change](curr.next = change)( [curr.next](curr.next) ) / front = change(front)  \n- Resulting solutions much cleaner than iterative cases  \n• We call this pattern x = change(x)","cbCaiiIgMaQynIT4","https://ap.wps.com/l/cbCaiiIgMaQynIT4","pdf",681095,11,"English","# Announcements\n# Linked Lists\n## Recursive Definition\n## Recursive Traversals\n# Modifying Linked Lists\n## Iterative Review\n## Recursive Modifications","[{\"question\":\"How is a linked list defined recursively?\",\"answer\":\"It is either empty or a node containing data and another linked list.\"},{\"question\":\"What is the base case for recursive traversal?\",\"answer\":\"The empty list is the guaranteed base case, because its result is immediately known.\"},{\"question\":\"How does recursive modification update a linked list?\",\"answer\":\"The method returns the changed list, which is assigned to curr.next or front. This lets the solution make changes without stopping one node early.\"}]","Linked Lists and Recursion - LEC 12 - Lecture notes | PDF",28,[145,149,152,156],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-12-03/f462f4ecc9d4735edb56629aa4fc693f.webp",983,552,{"page_no":14,"url":150,"width":151,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-12-03/a23cb43d9c09d4986e5685c393ca3e9d.webp",982,{"page_no":81,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-12-03/f887217b0b7cc1d77c06049f3c7195d4.webp",981,551,{"page_no":19,"url":157,"width":158,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-12-03/c6223e4a4e5149ae9c3941973d5b7cf7.webp",980,{"list":160,"token":66},[161,167,173,179,185,191,197,203,209,215],{"doc_id":162,"doc_title":163,"file_type":136,"home_preview_img_url":164,"slug":165,"view_count":19,"category_name":30,"create_tm":166},685718,"14-Linked-Lists - Tree Recursion with Lists - Linked List Structure and Processing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000182459/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796354399&Signature=YEOIr7lQtulmeRDC5%2FxprZnSjls%3D","14-linked-lists-tree-recursion-with-lists-linked-list-structure-and-processing",1794016971,{"doc_id":168,"doc_title":169,"file_type":136,"home_preview_img_url":170,"slug":171,"view_count":14,"category_name":30,"create_tm":172},685743,"12-Linked Lists - Algorithms: longest sublist sum to n","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000186244/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796354399&Signature=GvPqs4q2j0tgBuZsWi6%2Bx7J3y28%3D","12-linked-lists-algorithms-longest-sublist-sum-to-n",1794017227,{"doc_id":174,"doc_title":175,"file_type":136,"home_preview_img_url":176,"slug":177,"view_count":34,"category_name":30,"create_tm":178},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=1796354399&Signature=r%2FjGR4%2Bdnhmleeh0b2HNwLKXh40%3D","cs62-class-8-linked-lists-basic-data-structures",1794017629,{"doc_id":180,"doc_title":181,"file_type":136,"home_preview_img_url":182,"slug":183,"view_count":19,"category_name":30,"create_tm":184},732876,"Lecture 10 - Linked Lists - Lecture notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031413512/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796354399&Signature=oHsAOkScrAlJ4kpGrHwyrURTMBo%3D","lecture-10-linked-lists-lecture-notes",1795382672,{"doc_id":186,"doc_title":187,"file_type":136,"home_preview_img_url":188,"slug":189,"view_count":34,"category_name":30,"create_tm":190},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=1796354399&Signature=fv9Kvu02Q51AHP1OUuxCCJ%2BYN%2Fs%3D","lecture-12-doubly-linked-lists-with-recursion",1794446071,{"doc_id":192,"doc_title":193,"file_type":136,"home_preview_img_url":194,"slug":195,"view_count":24,"category_name":30,"create_tm":196},697945,"Linked Lists - Part 19 - Data Structures Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230009214291/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796354399&Signature=dNXyJmXECgqAHsagPSaD26Lxzog%3D","linked-lists-part-19-data-structures-lecture-notes",1794446271,{"doc_id":198,"doc_title":199,"file_type":136,"home_preview_img_url":200,"slug":201,"view_count":81,"category_name":30,"create_tm":202},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=1796354399&Signature=e8WG6uoBl4SRL6Oq8UI0sSvs5yU%3D","chapter-15-linked-data-structures-java-linked-lists-key-concepts",1795006731,{"doc_id":204,"doc_title":205,"file_type":136,"home_preview_img_url":206,"slug":207,"view_count":24,"category_name":30,"create_tm":208},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=1796354399&Signature=fFs3VUwph8fVJIk3PglmbmmFCCg%3D","lecture-17-linked-list-data-structure-part-ii-double-linked-list-applications-and-insertion",1795006749,{"doc_id":210,"doc_title":211,"file_type":136,"home_preview_img_url":212,"slug":213,"view_count":24,"category_name":30,"create_tm":214},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=1796354399&Signature=%2BejBx%2FPI1N1mcd%2FV8uteSYbsvpw%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":216,"doc_title":217,"file_type":136,"home_preview_img_url":218,"slug":217,"view_count":14,"category_name":30,"create_tm":219},782752,"10-linkedlist","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230054989948/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796354399&Signature=TbKGAqNmK%2Fnome9mS4UvLNb2T2s%3D",1796313805]