[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-719601-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-719601-en":130,"doc-similar-719601":165},{"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":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","chapter-9-data-structures-linked-lists-objectives-self-referential-classes","Chapter 9 - Data Structures: Linked Lists - Objectives & Self-Referential Classes","","Chapter 9 focuses on dynamic data structures, emphasizing linked lists as a core example. It explains why data structures affect efficient access and processing, contrasts static arrays with dynamically growing vectors, and introduces stacks and queues as related ADTs. The chapter defines self-referential classes using link references, clarifies the meaning of null links, and presents a generic Node class design plus examples for connecting nodes to form linked lists.",{"@graph":14,"@context":72},[15,34,55],{"@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-9-data-structures-linked-lists-objectives-self-referential-classes/719601/",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-9-data-structures-linked-lists-objectives-self-referential-classes/719601.png","ImageObject",300,407,{"name":42,"@type":43},"Alexandar","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-23","2026-11-18",true,{"@type":52,"interactionType":53,"userInteractionCount":26},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What does it mean for a data structure to be dynamic in this chapter?","Question",{"text":62,"@type":63},"A dynamic data structure can grow or change size after creation, unlike static structures such as arrays.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How is a self-referential class defined?",{"text":67,"@type":63},"It contains an instance variable that refers to another object of the same class type, where that variable is called a link.",{"name":69,"@type":60,"acceptedAnswer":70},"How do you connect two nodes to form a linked list?",{"text":71,"@type":63},"Create two Node objects (e.g., p and q), then set p.next to q so p points to q, forming a linked list with two nodes.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},719601,1795006745,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"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":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"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":26,"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":79,"read_time":144,"preview_page_count":96,"preview_urls":145},962090768658,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Chapter 9  \nData Structures: Linked Lists  \nCSC 113  \nKing Saud University  \nCollege of Computer and Information Sciences Department of Computer Science  \nDr. S. HAMMAMI  \nObjectives  \nAfter you have read and studied this chapter, you should be able to:  \nDr.  \nthe of dynamic data  \n-CS  \n• Understand the concept of a dynamic data structure.  \n• Be able to create and use dynamic data structures such as linked lists.  \n• Understand the stack and queue ADTs.  \n• Various important applications of linked data structures.  \n• Know how to use inheritance to define extensible data structures.  \n• Create reusable data structures with classes, inheritance and composition.  \nOutline  \nIntroduction  \nDr. Salah Hammami KSU-CCIS-CS  \n1. Introduction  \n2. Self-Referential Classes  \n2.1. Definition  \n2.2. Generic Node Class  \n2.3 . Example  \n2.4. Implementation of Generic Class Node  \n2.5. Connecting two nodes  \n2.6. Examples  \n3. Linked Lists  \n3.1. Definition  \n3.2. Graphical representation  \n3.3. Performance  \n3.4. Single Linked List  \n3.5. Basics Methods of Linked List: Implementation 3.6. Examples  \n1. Introduction  \ndata is organizes information that it  \nDr. Salah Hammami KSU-CCIS-CS  \n• A data structure is organizes information so that it efficient to access and process.  \n• An array is a static structure--it can’t change size once it is created.  \n• A vector is a dynamic structure--it can grow in size after creation.  \n• In this chapter we study several dynamic data structures--lists, queues, and stacks.  \n2. Self-Referential Classes: Definition  \n•Self-referential class  \nContains an instance variable that refers to another object of the same class type  \nThat instance variable is called a link  \nA null reference indicates that the link does not refer to another object  \nDr. Salah Hammami KSU-CCIS-CS  \n2. Self-Referential Classes (cont)  \nNode  \nA link to another Node object.  \nJamel   Kamal   \n Ali   \nDr. Salah Hammami KSU-CCIS-CS  \nBasic Node: The Generic Node Class  \n• A node in a linked list contains data elements and link elements.  \nDr. Salah Hammami KSU-CCIS-CS  \nGeneric Node Class: Implementation  \npublic class Node {  \nprivate Object data; // Stores any kind of data private Node next;  \npublic Node(Object obj ) { // Constructor data = obj ;  \nnext = null;  \n}  \n// Link access methods  \npublic void setNext ( Node nextPtr ) { next = nextPtr;  \n}  \npublic Node getNext () {  \nreturn next;  \n}  \n} // Node  \n// Data access methods  \npublic void setData (Object obj ){  \ndata = obj ;  \n}  \npublic Object getData () { return data;  \n}  \npublic String toString() { return data.toString ();  \n}  \nDr. Salah Hammami KSU-CCIS-CS  \nConnecting two nodes  \nThe statements  \nNode p = new Node(“Ali\");  \nNode q = new Node(“Jamel\");  \nallocate storage for two objects of type Node referenced by p and q. The node referenced by p stores the string “Ali\", and the node referenced by q stores the string “Jamel\" . The next fields of both nodes are null.  \nNodes referenced by p and q  \n Ali   Jamel   \nDr. Salah Hammami KSU-CCIS-CS  \nConnecting two nodes (Cont)  \nThe statement  \n[p.next = q](p.next = q) ;  \nstores the address of node q in the link field of node p, thereby connecting node p to node q, and forming a linked list with 2 nodes. The diagonal line in the next field of the second list node indicates the value null.  \nLinked list with two nodes  \n Ali   Jamel   \nDr. Salah Hammami KSU-CCIS-CS","cbCaisIRsergA1nX","https://ap.wps.com/l/cbCaisIRsergA1nX","pdf",758566,41,"English","# Introduction\n## Objectives\n## Self-Referential Classes: Definition\n### Generic Node Class\n### Connecting two nodes\n# Linked Lists\n## Definition\n## Graphical representation\n## Performance\n## Single Linked List\n## Basics Methods of Linked List","[{\"question\":\"What does it mean for a data structure to be dynamic in this chapter?\",\"answer\":\"A dynamic data structure can grow or change size after creation, unlike static structures such as arrays.\"},{\"question\":\"How is a self-referential class defined?\",\"answer\":\"It contains an instance variable that refers to another object of the same class type, where that variable is called a link.\"},{\"question\":\"How do you connect two nodes to form a linked list?\",\"answer\":\"Create two Node objects (e.g., p and q), then set p.next to q so p points to q, forming a linked list with two nodes.\"}]","Chapter 9 - Data Structures: Linked Lists - Objectives & Self-Referential Classes | PDF",103,[146,150,153,157,161],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/d9c83fa0b59fb2e5ef91e2715eb9b2f1.webp",983,736,{"page_no":26,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/359b13409a24bd1483833c0095e4b124.webp",982,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/db438fff3913c12e55927736f1c4ae93.webp",981,735,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/c477ee68916827839ebb5385c306a6b2.webp",980,734,{"page_no":96,"url":162,"width":163,"height":164},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/730c4cf2a353609152ac63e97352d470.webp",979,733,{"list":166,"token":11},[167,173,179,185,191,197,203,209,215,221],{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":33,"category_name":29,"create_tm":172},697962,"DATA STRUCTURES - Chapter 5 Basic Data Structures","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230009214987/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=Sn6MhfobxOSW1l%2Fg1ln347LcT8E%3D","data-structures-chapter-5-basic-data-structures",1794446352,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":30,"category_name":29,"create_tm":178},685724,"LINKED LISTS - Chapter 3 - overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000182527/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=krHIRlOED33cc0NX5TT2jwbftJg%3D","linked-lists-chapter-3-overview",1794016986,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":30,"category_name":29,"create_tm":184},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,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":30,"category_name":29,"create_tm":190},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=1796111999&Signature=YX7PxomIULgS8zFaHrVPhAsuL3g%3D","chapter-15-linked-data-structures-java-linked-lists-key-concepts",1795006731,{"doc_id":192,"doc_title":193,"file_type":137,"home_preview_img_url":194,"slug":195,"view_count":30,"category_name":29,"create_tm":196},671623,"Data Structures Cheat Sheet - Time Complexity and Core Properties","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988381074/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=2CCOBMbDwzHvhoCRhOJeA19C78s%3D","data-structures-cheat-sheet-time-complexity-and-core-properties",1793577648,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":96,"category_name":29,"create_tm":202},685730,"Chapter 4 Linked Lists - 4.1 Singly Linked Lists Or Chains","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000185878/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=eCteKXgRQmxhCYsGpIVUP%2BCDoIo%3D","chapter-4-linked-lists-41-singly-linked-lists-or-chains",1794017203,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":96,"category_name":29,"create_tm":208},685723,"Fundamentals of Linked Lists - Chapter Summary","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000182525/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=qdLidZICf2aRrBYXiwul3UQS6A0%3D","fundamentals-of-linked-lists-chapter-summary",1794016982,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":105,"category_name":29,"create_tm":214},697952,"Python Session 2 - Data Structures","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010141975/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=8X7JB5rhGwME71uBW2NdRLc%2FXVM%3D","python-session-2-data-structures",1794446325,{"doc_id":216,"doc_title":217,"file_type":137,"home_preview_img_url":218,"slug":219,"view_count":96,"category_name":29,"create_tm":220},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=1796111999&Signature=eUS5qZmrsZeOvQYSscOQa7khHK4%3D","rohini-college-of-engineering-technology-linked-list-implementation-singly-linked-lists-core-algorithms-for-traversal-counting-searching-and-insertion",1794017223,{"doc_id":222,"doc_title":223,"file_type":137,"home_preview_img_url":224,"slug":225,"view_count":115,"category_name":29,"create_tm":226},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=1796111999&Signature=OdcJZ1sJTC9S3xFEewFSJcDGh6A%3D","data-structures-using-python-r20a0503-lecture-notes",1794446274]