[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685793-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-685793-en":130,"doc-similar-685793":149},{"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":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","142-data-structures-specification-142","1.4.2 Data Structures - Specification - 1.4.2","","Advanced Notes Specification for Computer Science AS Level section 1.4.2 Data Structures covers four core structures: arrays (including 1D, 2D, and 3D with indexing and access syntax), records (rows with fields and recordName.fieldName access), lists (ordered, non-contiguous storage with operations like isEmpty, append, remove, search, length, index, insert, and pop), and tuples (immutable ordered collections with tuple initialization and read-only access). It also introduces stacks and queues concepts, emphasizing LIFO behavior and stack operations such as isEmpty, push, peek, and pop.",{"@graph":14,"@context":73},[15,34,56],{"@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/exam/","Exam",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/142-data-structures-specification-142/685793/",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/142-data-structures-specification-142/685793.png","ImageObject",300,407,{"name":42,"@type":43},"Stanford","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-12-01","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",9,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How do you access elements in a one-dimensional array, and what indexing is assumed?","Question",{"text":63,"@type":64},"A one-dimensional array is an ordered finite set of elements, and unless the question states otherwise, arrays are zero-indexed. The first element is at position 0.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What is a record and how are its fields accessed?",{"text":68,"@type":64},"A record is composed of fields and is commonly referred to as a row in a file or a database row. After creating the record, each field can be accessed using recordName.fieldName (for example, fighter.FirstName).",{"name":70,"@type":61,"acceptedAnswer":71},"What makes tuples different from lists or arrays?",{"text":72,"@type":64},"Tuples are ordered sets that are immutable, meaning elements cannot be added or removed once created. Attempting to modify them results in an error.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},685793,1794018669,{"code":4,"msg":82,"data":83},"success",[84,88,92,95,100,105,110,115,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":93,"slug":94},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":102,"show_sort_weight":103,"slug":104},6,"Technology",50,"technology",{"id":106,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},7,"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":112,"show_sort_weight":113,"slug":114},8,"Research & Report",30,"research-report",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},"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":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":33,"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":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":55,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":80,"read_time":143,"preview_page_count":22,"preview_urls":144},2336477552062,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","OCR Computer Science AS Level  \n1.4.2 Data Structures  \nAdvanced Notes  \nSpecification  \n1.4.2 a)  \n● Arrays  \n● Records  \n● Lists  \n● Tuples  \n1.4.2 b)  \n● Stack  \n● Queue  \nArrays, Records, Lists, and Tuples  \nArrays  \nAn array is an ordered, finite set of elements of a single type. A 1D (one-dimensional) array is a linear array. Unless stated in the question, arrays are always taken to be zero-indexed. This means that the first element in the array is considered to be at position zero. Below is an example of a one-dimensional array:  \n\n| oneDimensionalArray = [1, 23, 12, 14, 16, 29, 12] //creates a\u003Cbr>1D array\u003Cbr>print(oneDimensionalArray[3])\u003Cbr>>> 14 |\n| --- |\n| A two-dimensional array can be visualised as a table or spreadsheet. When searching through a 2D array, you first go down the rows and then across the columns to find a given position. This is the reverse to the method used to find a set of coordinates. Below is an example involving a two-dimensional array. |\n| twoDimensionalArray = [[123, 28, 90, 38, 88, 23, 47],[1, 23, 12, 14, 16, 29, 12]]\u003Cbr>print(twoDimensionalArray)\u003Cbr>>> [[23, 28, 90, 38, 88, 23, 47],\u003Cbr>[ 1, 23, 12, 14, 16, 29, 12]]\u003Cbr>print(twoDimensionalArray[1,3]) // Goes down and then across\u003Cbr>>> 14 |\n| A three-dimensional array can be visualised as a multi-page spreadsheet and can bethought of as multiple 2D arrays. Selecting an element in a 3D array requires the following syntax to be used: threeDimensionalArray[z,y,x], where z is the array number, y is the row number and x is the column number. |\n| threeDimensionalArray = [[[12,8],[9,6,19]],[[241,89,4,1],[19,2]]] print(threeDimensionalArray[0,1,2])\u003Cbr>>> 19 |\n\nRecords  \nA record is more commonly referred to as a row in a file and is made up of fields. Records are used in databases, as shown in the table below:  \n\n| ID | FirstName | Surname |\n| --- | --- | --- |\n| 001 | Antony | Joshua |\n| 002 | Tyson | Fury |\n| 003 | Deonte | Wilder |\n\nAbove is a file containing three records, where each record has three fields. A record is declared in the following manner:  \nfighterDataType = record  \nend  \ninteger string  \nstring record  \nID FirstName Surname  \nEach field in the record can be identified by recordName.fieldName. First, however, the record must be created. When creating a record, a variable must first be declared: fighter : fighterDataType  \nThen its attributes can be accessed, using the following syntax: fighter.FirstName  \nLists  \nA list is a data structure consisting of a number of ordered items where the items can occur more than once. Lists are similar to 1D arrays and elements can be accessed in the same way. The difference is that list values are stored non-contiguously. This means they do not have to be stored next to each other in memory, as data in arrays is stored. Lists can also contain elements of more than one data type , unlike arrays.  \nThere are a range of operations that can be performed involving lists, described in the table below. The following structure is used when manipulating lists:  \nList = [23, 36, 62, 49 , 23, 29, 12] List.function(Parameters)  \n\n| List Operations | Example | Description |\n| --- | --- | --- |\n| isEmpty() | List.isEmpty()>> False | Checks if the list is empty |\n| append(value) | List.append(15)>> | Adds a new value to the end of the list |\n| remove(value) | List.remove(23)>> | Removes the value the first time it appears in the list |\n| search(value) | [List.search](List.search) (38)>> False | Searches for a value in the list. |\n| length() | List.length()>> 7 | Returns the length of the list |\n| index(value) | List.index(23)>> 0 | Returns the position of the item |\n| insert(position, value) | List.insert(4,25)>> | Inserts a value at a given position |\n| pop() | List.pop()\u003Cbr>>>12 | Returns and removes the last value in the list |\n| pop(position) | list.pop(3) | Returns and removes the value in the list at the given position |\n\nTuples  \nAn ordered set of values of any type is called a tuple. A tuple is immuta","cbCaiuxBWkGoSVES","https://ap.wps.com/l/cbCaiuxBWkGoSVES","pdf",115901,"English","# 1.4.2 Data Structures\n## Arrays, Records, Lists, and Tuples\n## Stacks and Queues","[{\"question\":\"How do you access elements in a one-dimensional array, and what indexing is assumed?\",\"answer\":\"A one-dimensional array is an ordered finite set of elements, and unless the question states otherwise, arrays are zero-indexed. The first element is at position 0.\"},{\"question\":\"What is a record and how are its fields accessed?\",\"answer\":\"A record is composed of fields and is commonly referred to as a row in a file or a database row. After creating the record, each field can be accessed using recordName.fieldName (for example, fighter.FirstName).\"},{\"question\":\"What makes tuples different from lists or arrays?\",\"answer\":\"Tuples are ordered sets that are immutable, meaning elements cannot be added or removed once created. Attempting to modify them results in an error.\"}]","1.4.2 Data Structures - Specification - 1.4.2 | PDF",23,[145],{"page_no":22,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/7011714b6aa92cbcb0db5e8474285e5d.webp",983,1390,{"list":150,"token":11},[151,157,163,169,175,181,188,195,201,207],{"doc_id":152,"doc_title":153,"file_type":137,"home_preview_img_url":154,"slug":155,"view_count":96,"category_name":29,"create_tm":156},697981,"ICDL Computing Lesson 8 - Aggregate Data Types","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146836/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=lnqFB1H2ZxY0rOgRRIgBPWPyB10%3D","icdl-computing-lesson-8-aggregate-data-types",1794446564,{"doc_id":158,"doc_title":159,"file_type":137,"home_preview_img_url":160,"slug":161,"view_count":111,"category_name":29,"create_tm":162},685774,"UNIT 2 - Lists, Dictionaries And Sets","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203839/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=wR%2BHOAW%2FcBN8s76wThYI0PZbr74%3D","unit-2-lists-dictionaries-and-sets",1794018222,{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":106,"category_name":29,"create_tm":168},697967,"Data Structures Using Python - Course Syllabus - Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146279/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=m03bERvdpAnZ6ctyhjKv%2BFbBVOE%3D","data-structures-using-python-course-syllabus-lecture-notes",1794446538,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":55,"category_name":29,"create_tm":174},670584,"Java Data Structures Cheat Sheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988344079/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=WAKTqx8WhsnoemptqwClFSa4030%3D","java-data-structures-cheat-sheet",1793570142,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":106,"category_name":29,"create_tm":180},685775,"Lists, Dictionaries and Tuples - Topic - 1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203838/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=uVh0icI8jftF5eOp9hOecE7ahsw%3D","lists-dictionaries-and-tuples-topic-1",1794018224,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":186,"category_name":29,"create_tm":187},391904,"Deloitte Python Interview Questions - Basic Python Questions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917409659/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=lU6QKTskuhzQHwpbr4aYjgF7a8Y%3D","deloitte-python-interview-questions-basic-python-questions",14,1790359985,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":193,"category_name":29,"create_tm":194},461668,"Quiz 02-Practice - COMP 110 Practice Quiz - Spring 2024","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926083182/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=7KOE3mWcVFqej0F6BWsgyL83qUk%3D","quiz-02-practice-comp-110-practice-quiz-spring-2024",12,1790762100,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":106,"category_name":29,"create_tm":200},685781,"STUDENTS’ NOTE - ADVANCED PROGRAMMING I - FUNCTIONS AND ARRAYS/LISTS - Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000208883/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=N4Uw7N1WX0H6CxFy0R%2F2RxoLDd8%3D","students-note-advanced-programming-i-functions-and-arrayslists-notes",1794018466,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":127,"category_name":29,"create_tm":206},457689,"MSCIT Syllabus - Master of Science Information Technology Programme Structure and Detailed Curriculum","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229925374827/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=FGOzZLNU%2F9QwwuRYgb%2BsebqAGKk%3D","mscit-syllabus-master-of-science-information-technology-programme-structure-and-detailed-curriculum",1790750155,{"doc_id":208,"doc_title":209,"file_type":137,"home_preview_img_url":210,"slug":211,"view_count":30,"category_name":29,"create_tm":212},727274,"Data Structures Using Python - (R20A0503) Lecture Notes - B.TECH II Year I-Sem (R20)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230029071315/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796168519&Signature=OfZsbs6wUjqsUuEw7ec6yR75uao%3D","data-structures-using-python-r20a0503-lecture-notes-btech-ii-year-i-sem-r20",1795232719]