levo

Data Structures

Arrays of records

  • 3 things to know
  • AS Unit 1

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.

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.

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

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.

Fetch, , execute.
decodecompilestore

Blank Blitz makes facts automatic

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

AEncryption is reversible.
BThe stored form could be decrypted.
CA hash cannot be reversed.

Build It gets the exam shape right

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

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