levo

Objects, Classes and Data Structures

Choosing and organising data structures

  • 3 things to know
  • AS Unit 1
Start revising · £5/month

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.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

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

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A null is the of one.
absencepresencetype

Blank Blitz consolidates the facts

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

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

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.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

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