levo

Data Structures: Arrays, Records and Hash Tables

Manipulating arrays: insertion, deletion and searching

  • 3 things to know
  • Component 1

Overview

Flag value used for when deleting from an array, how the largest value in an array is found and initialising an array.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Describe how a new value is inserted into the middle of an ordered array.

Key term

Why is insertion into an array an expensive operation?

Key term

Describe how an element is deleted from the middle of an array.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Describe how a new value is inserted into the middle of an ordered array.

    Model answer

    Elements from the insertion point onwards are shifted one place towards the end. The new value is then written into the freed position.

  2. 2

    Why is insertion into an array an expensive operation?

    Model answer

    An insertion may have to move every element after the insertion point. The work grows with the number of elements already stored.

  3. 3

    Describe how an element is deleted from the middle of an array.

    Model answer

    Elements after the deleted position are shifted one place towards the front. The counter of items in use is then reduced by one.

  4. 4

    Why can an element not truly be removed from a static array?

    Model answer

    A static array keeps its declared size whatever the program does. A deletion only overwrites the value or marks the slot as unused.

  5. 5

    What is a flag value used for when deleting from an array?

    Model answer

    A flag value marks a slot as empty without moving any data. Searches then skip any element holding the flag.

  6. 6

    How is an ordered array searched efficiently?

    Model answer

    A binary search repeatedly halves the part of the array still to be examined. The middle element decides which half is discarded.

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.

Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs

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.

KDW to HAT.
decryptsencryptscompresses

Blank Blitz makes facts automatic

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

AThe two are not the same.
BOpen source refers to the availability of the code.
CMuch open source software is free of charge.

Build It gets the exam shape right

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

Backup means the copy of the data.
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: Arrays, Records and Hash Tables, 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.