levo

Objects, Classes and Data Structures

Choosing and organising data structures

  • 3 things to know
  • AS Unit 1

Overview

Matching the structure to the job — an array for a fixed run of the same type, a list where the length changes, a record for related fields of different types — and what each costs to search and to grow.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Why does a program hold related values in a data structure rather than in separate variables?

Key term

Give two problems with using thirty separate variables to hold thirty marks.

Key term

What does it mean to design a data structure for a particular task?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Why does a program hold related values in a data structure rather than in separate variables?

    Model answer

    A data structure keeps many related values under one name, so a loop can process them all, one argument can pass them to a method, and the program does not need a fresh variable for every item.

  2. 2

    Give two problems with using thirty separate variables to hold thirty marks.

    Model answer

    Thirty separate variables cannot be reached by an index, so every calculation has to name each one in turn, and storing a thirty-first mark means editing and recompiling the program.

  3. 3

    What is a data structure?

    Model answer

    A data structure is an organised arrangement of data in memory together with the operations that may be performed on it.

  4. 4

    What does it mean to design a data structure for a particular task?

    Model answer

    To design a data structure is to settle what each item will hold, how the items will be arranged and which operations the arrangement must make quick, before any code is written. A queue of print jobs, for example, is designed so the job waiting longest is always the next one taken.

  5. 5

    What does it mean to store data efficiently?

    Model answer

    Efficient storage means holding the data in as little memory as the task allows, with no value duplicated needlessly and no space reserved that will never be used.

  6. 6

    What does it mean to organise data efficiently?

    Model answer

    Efficient organisation means arranging the data so that the operations the program performs most often, such as searching, sorting or reading in order, take as few steps as possible.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Objects, Classes and Data Structures, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.