[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-697974-105":59,"doc-detail-697974-en":130,"doc-similar-697974":162},{"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","organizing-data-lists-linearly-2b-unit02b","Organizing Data Lists Linearly 2B - Unit02B","","Covers linear data organization with a focus on array-based lists and singly linked lists, explaining key disadvantages of arrays such as shifting elements on insert/delete and the requirement for contiguous memory. Introduces singly linked list structure using nodes and head references, including handling of empty lists. Provides Java-style class concepts (inner Node class) and core operations: initializing, adding the first element, getting size, removing the first node, traversing via toString, adding at a given index, and removing at a given index, concluding with complexity and disadvantages.",{"@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":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/organizing-data-lists-linearly-2b-unit02b/697974/",{"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/organizing-data-lists-linearly-2b-unit02b/697974.png","ImageObject",300,407,{"name":92,"@type":93},"Emma Wilson","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-15","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":14},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What makes array-based lists inefficient for insertions and removals?","Question",{"text":112,"@type":113},"When adding or removing an entry, elements must be shifted to keep the list updated. In the worst case, add and remove take O(n) time, and the array must store all data contiguously in memory.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does a singly linked list store data?",{"text":117,"@type":113},"Each data element is stored in its own node. Each node holds a reference to the next node, and the head reference points to the first node; the last node points to null.",{"name":119,"@type":110,"acceptedAnswer":120},"What operations are shown for managing a singly linked list in the document?",{"text":121,"@type":113},"The document presents initializing an empty list, addFirst, size, removeFirst, traversal via toString, plus adding and removing elements at a specified index, followed by notes on complexity and disadvantages.","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},697974,1794446551,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":14,"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},3848291630094,"https://eur-avatar.wpscdn.com/davatar_085a072bc5b1113ac321206ff7593b45","Organizing  \nData  \nLists  \nLinearly  \n2B  \nLinked Lists   \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 1  \nDisadvantages of Array Lists    \n􀀡 If a data entry is added to or removed from an array-based list, data needs to be shifted to update the list.  \n􀀡 In the worst case, for an array-based list with n data entries, an add and a remove takes O(n) time.  \n􀀡 Also, all data in the array-based list must be stored sequentially in memory. Large lists will require significant contiguous blocks of memory.  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 2  \nSingly Linked  \nLists  \n􀀡 Each data entry is stored in its own node.  \n􀀡 Each node has a reference to the node that contains the next data entry.  \n􀀡 A reference named the head points to the node with the first data entry.  \n􀀡 The last node in the list contains a reference of null since it does not point to any other data.  \n􀀡 An empty list would have a head reference equal to null.  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 3  \nVisualization  \ndata  \nnext  \n|  |  |\n| --- | --- |\n\na node  \na data element (type E)  \n\n|  |  |  |  |  |  |  |  |  |  |  |  |  | null |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  | |  |  | |  |  | |  |  | |  |  |\n\n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \nInner classes  \n􀀡 Since a node is specific to a linked list, we will define the Node class to be an inner class of the SinglyLinkedList class.  \n􀀡 The inner class is only accessible by the class that enclosed it.  \n􀀡 Fields defined in the inner class are accessible by its enclosing class. (No accessors are needed.)  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 5  \nNode class  \nprivate static class Node\u003CE> { private E data;  \nprivate Node\u003CE> next;  \nprivate Node(E element) { data = element;  \nnext = null;  \n}  \nprivate Node(E element, Node\u003CE> nodeRef) { data = element;  \nnext = nodeRef ;}  \n}  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 6  \nInitializing an empty linked list  \npublic class SinglyLinkedList\u003CE> {  \nprivate Node\u003CE> head;  \nprivate int numElements ;  \npublic SinglyLinkedList () { head = null;  \nnumElements = 0;}  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \nAdd new first list element Get size of list  \npublic void addFirst(E element) { head = new Node\u003CE>(element, head); numElements++;  \n}  \npublic int size() {  \nreturn numElements ;}  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \n8  \nRemoving the first node  \npublic E removeFirst () {  \nif (head == null)  \nthrow new NoSuchElementException (); [E result = head.data](E result = head.data);  \n[head = head.next](head = head.next);  \nnumElements- - ;  \nreturn result;}  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA 9  \nTraversing the list  \npublic String toString () {  \nString result = \"\";  \nNode\u003CE> nodeRef = head;  \nwhile (nodeRef != null) {  \nresult += [nodeRef.data](nodeRef.data) + \" ==> \"; [nodeRef = nodeRef.next](nodeRef = nodeRef.next);  \n}  \nreturn result;}  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \n10  \nAdd at given index  \npublic void add(int index, E element) { if (index \u003C 0 || index > size())  \nthrow new IndexOutOfBoundsException ();  \nif (index == 0) {  \naddFirst(element);  \nreturn;}  \n// cont'd  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \nAdd at given index Visualization  \nnewNode  \nWRONG  \n 2  \n\n|  | null\u003Cbr>|\n| --- | --- |\n\n11  \n|  |  |  |  |  |  |  |  |  |  |  |  |  | null |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n|  |  | |  |  | |  |  | |  |  | |  |  |\n\ninsert here  \n(index = 3)  \n15-121 Introduction to Data Structures, Carnegie Mellon University-CORTINA  \n12  \nAdd at given Visualization ","cbCaigz0UaRk7WXH","https://ap.wps.com/l/cbCaigz0UaRk7WXH","pdf",237239,17,"English","# Disadvantages of Array Lists\n# Singly Linked Lists\n## Visualization of nodes and pointers\n# Inner Classes and Node Class\n# Initializing an Empty Linked List\n# Adding and Removing Elements\n## addFirst and size\n## removeFirst\n## Traversing with toString\n## add at a given index\n## remove at a given index\n# Complexity and Disadvantages of Singly Linked Lists","[{\"question\":\"What makes array-based lists inefficient for insertions and removals?\",\"answer\":\"When adding or removing an entry, elements must be shifted to keep the list updated. In the worst case, add and remove take O(n) time, and the array must store all data contiguously in memory.\"},{\"question\":\"How does a singly linked list store data?\",\"answer\":\"Each data element is stored in its own node. Each node holds a reference to the next node, and the head reference points to the first node; the last node points to null.\"},{\"question\":\"What operations are shown for managing a singly linked list in the document?\",\"answer\":\"The document presents initializing an empty list, addFirst, size, removeFirst, traversal via toString, plus adding and removing elements at a specified index, followed by notes on complexity and disadvantages.\"}]","Organizing Data Lists Linearly 2B - Unit02B | PDF",43,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/a1eae41609754d391abd2b9e650b0be6.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/fa8676b27ffdb9652abba39081eb5b4c.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/2122ee5d3261fad332c7d529c3be6c90.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/6f6497b603b98533c39c4b70f60a8c44.webp",980,1268,{"list":163,"token":66},[164,170,176,183,189,196,203,209,216,222],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":39,"category_name":40,"create_tm":169},450326,"Average distance between the processors of biswapped networks","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229924852936/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=CpEQ69I7%2FllAZG0az6ge%2FcQHXzg%3D","average-distance-between-the-processors-of-biswapped-networks",1790732897,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":39,"category_name":40,"create_tm":175},440965,"Association of a high versus low number of negative lymph nodes removed with survival and recurrence-free survival after lymph node dissection in breast cancer: a systematic review and meta-analysis of observational studies","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229924545028/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=SD9K3Asl%2Fmj0M2bne8C53ltWRsk%3D","association-of-a-high-versus-low-number-of-negative-lymph-nodes-removed-with-survival-and-recurrence-free-survival-after-lymph-node-dissection-in-breast-cancer-a-systematic-review-and-meta-analysis-of-observational-studies",1790694119,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":181,"category_name":40,"create_tm":182},82470,"Dual-Informed Vertical Expansion for Multi-Objective Node Selection in Anytime Conflict-Based Search","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808895881/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=MBiSGrZzhtm3rGAYOBMO48PZOnY%3D","dual-informed-vertical-expansion-for-multi-objective-node-selection-in-anytime-conflict-based-search",26,1784180715,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":52,"category_name":40,"create_tm":188},473814,"Introducing the WAIS–IV","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926393011/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=vR3JBSvVcxCWKaF38VfVSTt7Oq4%3D","introducing-the-waisiv",1790783067,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":40,"create_tm":195},596314,"Approaching the Concept of Multiliteracies - Multilingual Writing Competence as an Integrated Model","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229955321306/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=qPOIenh0gghA4j47qAjmFsZTlkY%3D","approaching-the-concept-of-multiliteracies-multilingual-writing-competence-as-an-integrated-model",11,1792082846,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":201,"category_name":40,"create_tm":202},341884,"A metabolic-inflammatory-nutritional score (MINS) is associated with lymph node metastasis and prognostic stratification for endometrial cancer patients","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910587998/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=6ys29xuestQlTuchCaK9VuoYsSQ%3D","a-metabolic-inflammatory-nutritional-score-mins-is-associated-with-lymph-node-metastasis-and-prognostic-stratification-for-endometrial-cancer-patients",18,1790044259,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":19,"category_name":40,"create_tm":208},709156,"Index of Classes by Salary Grade - IV","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230016432633/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=7ST5qA8of5QvRZLiiQNK7OS0d80%3D","index-of-classes-by-salary-grade-iv",1794743638,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":214,"category_name":40,"create_tm":215},510051,"TC Pay Proposal Final","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229934859178/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=exZq%2BN5ilmA2fH%2FbwCmPPVvzOEM%3D","tc-pay-proposal-final",12,1791238750,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":194,"category_name":40,"create_tm":221},670249,"2026 Academic Year Calendar for International Students - Academic Events Schedule","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988690949/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Uhe5OdAlW6qOEbaY0LHqv66dfEQ%3D","2026-academic-year-calendar-for-international-students-academic-events-schedule",1793568089,{"doc_id":223,"doc_title":224,"file_type":137,"home_preview_img_url":225,"slug":226,"view_count":39,"category_name":40,"create_tm":227},344008,"Development of a Risk Prediction Model for Personalized Assessment of Postoperative Recurrence Risk in Colon Cancer Patients","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910442188/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Fiaz6YhtwJkyML5543AZneQiRo4%3D","development-of-a-risk-prediction-model-for-personalized-assessment-of-postoperative-recurrence-risk-in-colon-cancer-patients",1790052757]