[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-697962-105":59,"doc-detail-697962-en":130,"doc-similar-697962":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","data-structures-chapter-5-basic-data-structures","DATA STRUCTURES - Chapter 5 Basic Data Structures","","Chapter 5 focuses on the fundamentals of data structures and how they support efficient algorithm design. It explains what data structures are, why abstract data structures (ADTs) matter, and how arrays, stacks, queues, and linked lists are used with standard operations like create, delete, update, and traverse. The chapter introduces linear search using array traversal and frames performance in terms of relationships between data structures and algorithms, supported by formal objectives and structured examples.",{"@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/data-structures-chapter-5-basic-data-structures/697962/",{"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/data-structures-chapter-5-basic-data-structures/697962.png","ImageObject",300,407,{"name":92,"@type":93},"WHO AM I","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-15","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the main purpose of learning data structures in this chapter?","Question",{"text":112,"@type":113},"The chapter emphasizes understanding data structures to become an accomplished programmer and algorithm designer, enabling efficient organization, retrieval, and processing of data.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What are abstract data types (ADTs) and how are they defined?",{"text":117,"@type":113},"ADTs describe an abstraction of types based on the operations that can be performed, along with any stated restrictions on those operations.",{"name":119,"@type":110,"acceptedAnswer":120},"How is linear search performed on an array?",{"text":121,"@type":113},"Linear search traverses the array elements to find the target, using a flag to track whether the element has been found.","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},697962,1794446352,{"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":19,"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},10857686687108,"https://eur-avatar.wpscdn.com/avatar/9e0008edd84b319fe0c?x-oss-process=image/resize,m_fixed,w_180,h_180&k=1794290847020028784","DATA STRUCTURES  \nBad programmers worry about the code.  \nGood programmers worry about data structures and their relationships.  \n—Linus Torvalds  \nChapter 5 Basic Data structures  \nChapter 6 trees  \nChapter 7 Graphs  \nChapter 8 sorting in Linear and Quadratic time  \nCHAPTER  \n5  \nBasic Data Structures  \nOBJECTIVES  \nAfter studying this chapter, the reader will be able to  \n• Understand the concept of data structures  \n• Appreciate the importance of abstract data structures  \n• Understand and use arrays and implement various operations such as search and traverse  \n• Understand the linked list and various operations on a singly linked list  \n• Differentiate between a doubly linked list and a circular linked list  \n• Understand the concept of stacks  \n• Implement stacks using arrays and linked list  \n• Understand the concept of queues  \n• Implement queues using arrays and linked list  \n• Understand the importance of data structures vis-à-vis algorithms  \n5.1 INTRODUCTION   \nFor most of the readers, the primary aim of reading this book is to become an accomplished programmer or an accomplished algorithm designer. It is important to understand the concept of data structures in order to do that. It is essential to be able to develop algorithms, analyse them, and make them as efficient as possible. This efficiency can be attained in two ways, either by the techniques explained in the following sections or by using efficient data structures. This chapter concentrates on the latter. In order to make things happen efficiently, it is essential to organize the data so that its retrieval becomes easy. This branch of computer science deals with not just the organization of data and its retrieval, but also the processing alternatives. Finally, in order to become a good programmer, one must understand both data structures and algorithms.  \nEven the basic data types, provided by a language, such as int, float, and char, are considered as data structures. They are called primal data structures. The more intricate ones such as arrays, stacks, and linked lists described in the following sections are called  \nBasic Data structures ■ 79  \nnon-primal data structures. The latter can be linear as in the case of a stack or a queue or can be non-linear like a graph or a tree. Trees and graphs have been discussed in Chapters 6 and 7, respectively, of this book.  \nEach data structure comes with standard operations such as create, delete, update, and traverse. Let us now explore the tremendous world of data structures. In the journey, one must try to empower oneself with the immense powers of the data structures so that the war of algorithms can be fought and won.  \n5.2 ABSTRACT DATA TYPES  \nAbstract data types (ADTs) refer to the abstraction of certain class of types that have similar behaviour. Such data structures are defined by the operations that can be performed on the above said class. At times, the restrictions on such operation(s) are also stated along with the ADT. One of the classical examples of an ADT is stack. Stack is a linear data structure that follows the principle of last in first out. The behaviour of a stack may be defined by push, pop, underflow, and overflow operations. The push operation inserts an element into the stack at the position indicated by the value of TOP. The pop operation takes out an element from the stack and decrements the value of TOP. The overflow operation checks if the value of TOP increments MAX-1, where MAX is the maximum number of elements that can be stored in the stack. The underflow operation, on the other hand, checks if the pop operation is running when the value of TOP is-1, that is, there is no element in the array and still pop is being invoked. The stack ADT has been implemented using both arrays and linked list in the following sections. In the above discussion, the various operations that can be performed on a stack and the constraints on the operations have been discussed. The above discussion al","cbCaiffhwZRNB491","https://ap.wps.com/l/cbCaiffhwZRNB491","pdf",2043259,31,"English","# Chapter 5 Basic Data structures\n## Objectives\n## 5.1 Introduction\n## 5.2 Abstract Data Types\n## 5.3 Arrays\n## 5.3.1 Linear Search","[{\"question\":\"What is the main purpose of learning data structures in this chapter?\",\"answer\":\"The chapter emphasizes understanding data structures to become an accomplished programmer and algorithm designer, enabling efficient organization, retrieval, and processing of data.\"},{\"question\":\"What are abstract data types (ADTs) and how are they defined?\",\"answer\":\"ADTs describe an abstraction of types based on the operations that can be performed, along with any stated restrictions on those operations.\"},{\"question\":\"How is linear search performed on an array?\",\"answer\":\"Linear search traverses the array elements to find the target, using a flag to track whether the element has been found.\"}]","DATA STRUCTURES - Chapter 5 Basic Data Structures | PDF",78,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/8b4d5448d71bc60ab96f4e3af0e29208.webp",983,1245,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/8d151294fe2dcd4e8f07d755939251fb.webp",982,1243,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ece96b495a652a88766f33734c2d57e5.webp",981,1242,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/955275fe729e586177f4f9106aaaac6f.webp",980,1241,{"list":163,"token":66},[164,170,176,182,188,195,201,207,212,218],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":34,"category_name":30,"create_tm":169},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=1796111939&Signature=1AqUXIDvSWXRxjm9prDcTikAWHU%3D","python-session-2-data-structures",1794446325,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":81,"category_name":30,"create_tm":175},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=1796111939&Signature=q3bFU5%2Fm45sTWvQLPI4eZdZKvD8%3D","linked-lists-chapter-3-overview",1794016986,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":14,"category_name":30,"create_tm":181},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=1796111939&Signature=x5kXEnLYBdbSmIfYNCyWtM0lZZA%3D","chapter-9-data-structures-linked-lists-objectives-self-referential-classes",1795006745,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":81,"category_name":30,"create_tm":187},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=1796111939&Signature=P0pfdJijbTCiktS%2FFa3pFpLmb%2FM%3D","data-structures-cheat-sheet-time-complexity-and-core-properties",1793577648,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":193,"category_name":30,"create_tm":194},326900,"Concise Algorithmics - Algorithms and Data Structures—The Basic Toolbox - Part 1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229908461102/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=t6CFsjUtQoVo%2F6%2FqWDpnyc0ZsQM%3D","concise-algorithmics-algorithms-and-data-structuresthe-basic-toolbox-part-1",13,1789975711,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":24,"category_name":30,"create_tm":200},697959,"Cheatcode-Book - How to Prepare for Interviews","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010142285/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=HzypB%2BndEg43sfiinOnabPM%2FKto%3D","cheatcode-book-how-to-prepare-for-interviews",1794446344,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":24,"category_name":30,"create_tm":206},685756,"UNIT- I - Introduction to Data Structures and Linear Data Structures","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000192540/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=GHJyohzkHDwYfZuxJHkLFeaqzys%3D","unit-i-introduction-to-data-structures-and-linear-data-structures",1794017620,{"doc_id":208,"doc_title":209,"file_type":137,"home_preview_img_url":210,"slug":211,"view_count":81,"category_name":30,"create_tm":169},697953,"Learn Python Data Structures & Algorithms Visually - Volume 1 - Trees, Linked Lists, Strings, Arrays","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010141919/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=%2FGsk112w07XdaPUjBmdArnBKtuM%3D","learn-python-data-structures-algorithms-visually-volume-1-trees-linked-lists-strings-arrays",{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":44,"category_name":30,"create_tm":217},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=1796111939&Signature=KwJFbH5CvTLJktT8XkWPsFT0qsY%3D","data-structures-using-python-r20a0503-lecture-notes",1794446274,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":29,"category_name":30,"create_tm":223},685764,"Lists and Linked Lists - Part 1 - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999691137/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111939&Signature=dy%2FF3rdjHBa0WfWsEGqiJ%2BrEcek%3D","lists-and-linked-lists-part-1-introduction",1794017635]