A-Level Computing data structures
Objectives Know how the ways data is stored and organised in a computer system Understand how data can be manipulated and referenced in an array Be able to explain the need for each type of data structure
Data Arrays A data structure is a way of organising data so that it can be efficiently processed An array is a type of data structure, and appears as a table or list Used to hold data (e.g. names) of the same type
Data Arrays The data items in an array are called its elements. Each element has a subscript to identify it SubscriptName 0Grant 1Tim 2Jake 3Ben 4Liam
Data Arrays A one-dimensional array is an array where each item is identified by one subscript. Items are identified as: Name[2] = ‘Jake’ If Name[n] = Grant....what is n?
Data Arrays A two-dimensional array is an array where two subscripts are needed to identify each element. JanuaryFebruaryMarch Tim£450£320£520 Grant£430£300£200 Jake£340£285£410 Ben£120£450£400 Liam£250£310£375 Helen£475£300£280 sales[2,1] = £285
Data Arrays D Score Steve45 Mark23 Kelly67 Gary35
Data Arrays D ICTMathsEnglishArt Steve Mark Kelly Gary
Data Arrays D! Year 7 Scores ICTMathsEnglishArt Steve Mark Kelly Gary Year 8 Scores ICTMathsEnglishArt Steve Mark Kelly Gary Year 9 Scores ICTMathsEnglishArt Steve Mark Kelly Gary
Records A record consists of a number of fields A field consists of a single data item and these may be of different types In a program, the field name and data type need to be declared For example a record may consist of four fields....
Records FieldData Type Student idInteger NameString ClassString Exam AverageReal