levo

Data Structures: Arrays, Records and Hash Tables

Manipulating arrays: insertion, deletion and searching

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

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.

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.

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

Cram the night before, weakest topic first

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

KDW to HAT.
decryptsencryptscompresses

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.

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