[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-697943-105":59,"doc-detail-697943-en":130,"doc-similar-697943":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","lecture-12-doubly-linked-lists-with-recursion","Lecture 12 Doubly Linked Lists - (with Recursion)","","Lecture 12 introduces doubly linked lists and explains why they are useful when traversal direction and efficient insertions matter. It contrasts singly linked lists with doubly linked lists, defines DLL nodes including data, next, and previous references, and discusses the head entry point and null termination. The lecture then presents recursion as a self-referential structure for recursive algorithms and demonstrates recursive search using base and recursive cases.",{"@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/lecture-12-doubly-linked-lists-with-recursion/697943/",{"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/lecture-12-doubly-linked-lists-with-recursion/697943.png","ImageObject",300,407,{"name":92,"@type":93},"naya.afterrain","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-21","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":34},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the key difference between singly linked lists and doubly linked lists?","Question",{"text":112,"@type":113},"Singly linked lists can be navigated only in one direction from the head, while doubly linked lists maintain both forward and backward references via next and previous pointers.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Why is recursion suitable for linked list problems?",{"text":117,"@type":113},"Linked lists are recursive data structures because each node references another node of the same type, allowing recursive algorithms to solve problems by breaking them into smaller sublists.",{"name":119,"@type":110,"acceptedAnswer":120},"How does the lecture define a recursive search in a doubly linked list?",{"text":121,"@type":113},"It uses two main cases: a base case where the target is the first node or the list is NULL (not found), and a recursive case where the search continues on the tail (smaller list) otherwise.","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},697943,1794446071,{"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":34,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"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":129,"read_time":143,"preview_page_count":19,"preview_urls":144},962094248482,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Lecture 12 Doubly Linked Lists  \n(with Recursion)  \nIn this lecture  \n• Introduction to Doubly linked lists  \n• What is recursion?  \n• Designing a node of a DLL  \n• Recursion and Linked Lists  \no Finding a node in a LL (recursively)  \no Printing a LL (recursively)  \no Appending a node to a LL (recursively)  \no Reversing a LL (recursively)  \n• Further Readings  \n• Exercises  \nIntroduction to Doubly Linked Lists  \nAs we learnt before, singly linked list is a structure that contains at least two fields, data field and a pointer to the next node. Singly linked lists are flexible structures where memory can be allocated in “small” blocks as needed. Also, when deleting or inserting nodes from a singly linked list, the overhead is relatively low compared to array insertions where array elements have to be moved with a greater cost. This makes singly linked lists (LL) preferred data structures to use in many applications.  \nHowever, one drawback in LL is that list can only be navigated in one direction and all navigations must start from the head node. But imagine an application where nodes needs to be inserted quickly, in order, and the data file typically provides clusters of data that needs to be inserted close to each other. It is quite common in data sets to have related data close to each other. For example, think of a user database where names are almost sorted and therefore needs to be inserted next to each other. In this case, it makes sense for the current pointer to remain in place until the next value is read from the data set. Based on the value of the date set, the current pointer can move forward or backwards to insert data in correct place.  \nA doubly linked list is a collection of objects linked together by references from one object to another object, both forward and backward. By convention these objects are named as nodes. So the basic DLL is a collection of nodes where each node contains one or more data fields AND references to next node and previous node. The next pointer of the last node points to a NULL reference and the previous pointer of first node points to NULL to indicate the end of the list in both ways.  \nCopyright @ 2009 Ananda Gunawardena  \nThe entry point into a DLL is always the first or head of the list. It should be noted that head is NOT a separate node, but a reference to the first Node in the list. If the list is empty, then the head has the value NULL. Unlike Arrays, nodes cannot be accessed by an index since memory allocated for each individual node may not be contiguous. We must begin from the head of the list and traverse the list sequentially to access the nodes in the list. Insertions of new nodes and deletion of existing nodes are fairly easy to handle. Recall that array insertions or deletions may require adjustment of the array (overhead), but insertions and deletions in linked lists can be performed very efficiently.  \nDesigning a Doubly Linked List Node  \nA doubly linked list node contains, minimally a data field and two pointers, one to next node and other to previous node. The following struct can be used to define a DLL node  \ntypedef struct DLLNode { void* data;  \nstruct DLLNode *next;  \nstruct DLLNode* prev;} DLLNode;  \nIntroduction to Recursion  \nRecursion is the process of an object to refer to another object that may have the same structure. Recall that the definition of node in a singly linked list is called a recursive data structure. That is, the definition of the node includes a reference to itself. This allows us to create a linked list, where each node points to another node just like that. Therefore, linked lists are ideal data structures for implementing recursive algorithms.  \nRecursive algorithms are elegant and allow us to solve complex problems that are otherwise may be difficult to solve. Another benefit of recursion is that the solution to the problem is constructed using a solution to a simple case, and a solution to a recursive problem. Recursion is fairly cl","cbCaii0qMWjW2Elm","https://ap.wps.com/l/cbCaii0qMWjW2Elm","pdf",56083,"English","# Introduction to Doubly Linked Lists\n## Designing a Doubly Linked List Node\n# Introduction to Recursion\n# Recursion and Linked Lists\n## Recursive Search Definitions\n## Base Case\n## Recursive Case","[{\"question\":\"What is the key difference between singly linked lists and doubly linked lists?\",\"answer\":\"Singly linked lists can be navigated only in one direction from the head, while doubly linked lists maintain both forward and backward references via next and previous pointers.\"},{\"question\":\"Why is recursion suitable for linked list problems?\",\"answer\":\"Linked lists are recursive data structures because each node references another node of the same type, allowing recursive algorithms to solve problems by breaking them into smaller sublists.\"},{\"question\":\"How does the lecture define a recursive search in a doubly linked list?\",\"answer\":\"It uses two main cases: a base case where the target is the first node or the list is NULL (not found), and a recursive case where the search continues on the tail (smaller list) otherwise.\"}]","Lecture 12 Doubly Linked Lists - (with Recursion) | PDF",15,[145,149,153,157],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e3fb560ee54e36c7020bf2d4e72edaee.webp",983,1272,{"page_no":14,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/be5b6cf1b6dea00257700f2110cb0431.webp",982,1270,{"page_no":81,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/a10ea971bc89acc933a299f15a9ba7b8.webp",981,1269,{"page_no":19,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ce57b71944ae4c62ca34984d82a1e22c.webp",980,1268,{"list":162,"token":66},[163,169,175,181,186,192,198,204,210,216],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":34,"category_name":30,"create_tm":168},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=1796110439&Signature=sKXzaShhaf4YbEkTJ8EANqFuy9c%3D","lecture-five-linked-list-structure",1794017204,{"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},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=1796110439&Signature=6kfJNZmPsnglAnL3qWSW5DkYy2g%3D","l6b-linked-list-variations-lecture-6b",1794017196,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":24,"category_name":30,"create_tm":180},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=1796110439&Signature=JfiBDOY3GLUSMWwevaOxWYD6rhI%3D","linked-lists-introduction-properties-advantages-disadvantages-and-types",1794016969,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":19,"category_name":30,"create_tm":174},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=1796110439&Signature=HwMuaceGXDea45RDNGQrd%2BMrEK4%3D","circular-linked-lists-all-operations-and-complexity-analysis",{"doc_id":187,"doc_title":188,"file_type":137,"home_preview_img_url":189,"slug":190,"view_count":24,"category_name":30,"create_tm":191},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=1796110439&Signature=vcCj5sEEmvH3hp9rqjMOsvumxjY%3D","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion",1794017223,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":19,"category_name":30,"create_tm":197},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=1796110439&Signature=cSTUYDR7uHC42VYrpmIawRO5Hyw%3D","lecture-10-linked-lists-lecture-notes",1795382672,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":81,"category_name":30,"create_tm":203},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=1796110439&Signature=qpPnfwsRQCE6SQqdB4%2Fiyl1ghxk%3D","singly-linked-lists-in-c-introduction-and-traversal-example",1795382670,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":34,"category_name":30,"create_tm":209},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=1796110439&Signature=TXxkmJGrTnG52eQqFitxCWawoYo%3D","cs62-class-8-linked-lists-basic-data-structures",1794017629,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":24,"category_name":30,"create_tm":215},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=1796110439&Signature=3ZZO9jwG3lMM39bBmhNk8G3P8ho%3D","linked-list-course-13004700-part-2",1794017631,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":24,"category_name":30,"create_tm":221},685721,"Sequences - Representing Sequences by Arrays and Linked Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999688553/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=BfImQ1ZfCkuhlnq526KjHoJt7Tc%3D","sequences-representing-sequences-by-arrays-and-linked-lists",1794016978]