Session XP: 0
Topic 1AComponent 1

Data Structures & Arrays

1D arrays, 2D arrays, records, and how data structures appear in programs. Jun 2022 Q5(a)(i)/(ii) tested arrays directly.

—
Best score
—
Last attempt
Best attempt progress
0
XP earned
Watch first — Craig 'n' Dave
Craig 'n' Dave · Edexcel 1CP2Data Structures
Key facts

Arrays — fill in the table

Indexing typically starts at 0 in most languages. (Jun 2022 Q5(a)(i): "Array" or "List" both accepted. Q5(a)(ii): colours[1] = "Yellow".)

TermDefinition
1D array
2D array

Records and other structures — fill in the table

PointDetail
Record
Arrays vs records
Array of records
Files

Data types — must know these — fill in the table

Data typeExample
Integer
Real/Float
Boolean
String
Character

Choosing the wrong data type causes bugs — e.g. storing "42" as a string means you cannot do arithmetic on it.

Exam questions — 4 questions · 13 marks · from real 1CP2 past papers
1 markArray definition1CP2 Jun 2022 Q5(a)(i) style

What type of data structure stores a collection of items of the same data type, accessed by index?

A Record
B File
C Array
D Boolean
2 marksArray indexing1CP2 Jun 2022 Q5(a)(ii) style

An array is defined as: colours = ["Red", "Green", "Blue", "Yellow", "Purple"] What is the value of colours[1]? And what index does "Purple" have? (2 marks)

Hint: Remember: index 0 = first element. Count from 0.
+20 XP
2 marksRecord vs array1CP2 style

Explain the difference between an array and a record as data structures. (2 marks)

Hint: Key distinction: arrays = same data type. Records = can have different data types (fields). Give an example for each.
+20 XP
1 markBoolean data type1CP2 style

A program needs to store whether a light switch is on or off. Which data type is most appropriate?

A Integer
B String
C Real
D Boolean
Quick recall flashcards

Module complete! 🎉

Score loading...

⚡ +10 XP