8.2

Data structures

9 flashcards to master Data structures

Smart Spaced Repetition

Rate each card Hard, Okay, or Easy after flipping. Your progress is saved and cards are scheduled for optimal review intervals.

Definition Flip

Define a 1D array and provide an example of its use.

Answer Flip

A 1D array is a linear data structure that stores a collection of elements of the same data type under a single variable name, accessed via an index.

Example: `names = ['Alice', 'Bob', 'Charlie']` stores three names.
Key Concept Flip

Explain the difference between a 1D and a 2D array, providing a real-world example for each.

Answer Flip

A 1D array is a single row of elements, like a list. A 2D array is a table of rows and columns, like a spreadsheet. Example 1D: days of the week. Example 2D: seating arrangement in a cinema.

Definition Flip

What is a 'record' in the context of data structures? Give an example.

Answer Flip

A record is a collection of fields, possibly of different data types, treated as a single unit.

Example: A student record might contain name (string), age (integer), and grade (character).
Definition Flip

Describe the purpose of a 'file' in computer science, and outline two common file types.

Answer Flip

A file is a named location on storage that holds data or information. Two common file types are text files (

Example: `.txt`) and binary files (. `.jpg`).
Key Concept Flip

Explain the difference between 'read', 'write', and 'append' operations when working with files.

Answer Flip

'Read' retrieves data from a file. 'Write' overwrites existing data or creates a new file. 'Append' adds data to the end of an existing file.

Key Concept Flip

Explain the significance of the 'open' and 'close' operations when working with files.

Answer Flip

'Open' prepares a file for reading or writing, establishing a connection between the program and the file. 'Close' terminates this connection, releasing resources and ensuring data is saved.

Key Concept Flip

Give an example scenario where using a 2D array would be more appropriate than using a 1D array. Explain why.

Answer Flip

Storing the scores of students in multiple subjects. A 2D array allows easy access to a specific student's score in a specific subject using row (student) and column (subject) indices, which isn't directly possible in a 1D array.

Key Concept Flip

Describe how to access the element in the 2nd row and 3rd column of a 2D array named 'data' using typical array indexing.

Answer Flip

Assuming the array is indexed starting from 0, the element in the 2nd row and 3rd column would be accessed as `data[1][2]`.

Key Concept Flip

Explain why efficient file handling (opening and closing files correctly) is crucial in programming.

Answer Flip

Correct file handling prevents data loss, corruption, and resource leaks. Failing to close a file can leave it open and inaccessible to other programs and might cause the data being written to not be fully saved.

Review the material

Read revision notes with definitions, equations, and exam tips.

Read Notes

Test yourself

Practice with MCQ questions to check your understanding.

Take Quiz
8.1 Programming concepts 8.3 Procedures and functions

Key Questions: Data structures

Define a 1D array and provide an example of its use.

A 1D array is a linear data structure that stores a collection of elements of the same data type under a single variable name, accessed via an index.

Example: `names = ['Alice', 'Bob', 'Charlie']` stores three names.
What is a 'record' in the context of data structures? Give an example.

A record is a collection of fields, possibly of different data types, treated as a single unit.

Example: A student record might contain name (string), age (integer), and grade (character).
Describe the purpose of a 'file' in computer science, and outline two common file types.

A file is a named location on storage that holds data or information. Two common file types are text files (

Example: `.txt`) and binary files (. `.jpg`).

About Data structures (8.2)

These 9 flashcards cover everything you need to know about Data structures for your Cambridge IGCSE Computer Science (0478) exam. Each card is designed based on the official syllabus requirements.

What You'll Learn

How to Study Effectively

Use the Study Mode button above to test yourself one card at a time. Try to answer each question before flipping the card. Review cards you find difficult more frequently.

Continue Learning

After mastering Data structures, explore these related topics: