levo

Data Structures

Arrays of records

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

Overview

Array of records, how the record with a given membership number is found and how records meeting a condition are counted.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Describe how the record with a given membership number is found in an array of records

Key term

In what way does an array of records resemble a file of records?

Key term

Why is a two-dimensional array a poor substitute for an array of records?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is an array of records?

    Model answer

    It is an array in which every element is a complete record, giving a table where each element is one entity and each field of the record is a column of that table.

  2. 2

    How is a single field of one element of an array of records referred to?

    Model answer

    The array is indexed first and the field then named, as in members[3].surname.

  3. 3

    Write pseudocode to output the surname of every member in an array of 100 member records.

    Model answer

    FOR i FROM 0 TO 99, OUTPUT members[i].surname, END FOR.

  4. 4

    Describe how the record with a given membership number is found.

    Model answer

    A loop runs through the elements in use comparing the membership field with the target, stops and reports the index as soon as they match, and reports that it is absent if the loop finishes without a match.

  5. 5

    How is a field of one record in the array updated?

    Model answer

    By assigning to that field of the indexed element, as in setting members[7].balance to members[7].balance − 5.

  6. 6

    Describe how records meeting a condition are counted.

    Model answer

    A counter is set to zero and a loop tests the relevant field of every element in use, adding one to the counter each time the test succeeds.

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.

Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types

Cram the night before, weakest topic first

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

Fetch, , execute.
decodecompilestore

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.

A bit is a single binary digit.
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 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.