levo

Data Structures

  • 9 subtopics
  • 21 things to know
  • Component 01

Learn Data Structures in runs of four questions, then keep it with spaced repetition.

What Data Structures covers

Data Structures is examined on component 01 of OCR Computer Science, Computer systems. 124 recall questions across 9 subtopics.

Where it is assessed

Component 01

Computer systems, the whole of the first paper.

Check the OCR specification ↗

The 9 subtopics

Each one has its own page.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is a record?

Key term

What is the key difference between an array and a record?

Key term

What is a list?

Key term

How do you add an item to an array, and to a list?

Key term

How do you search a linked list for a value?

Key term

What is a stack?

Key term

Describe the push operation.

Key term

What does peek do, and how is it different from pop?

Key term

What is a queue?

Key term

Give three uses of a queue in a computer system.

Key term

What is wrong with a plain linear queue after it has been used for a while?

Key term

Give three real-world things that are naturally modelled as graphs.

Key term

A graph has nodes A, B, C, D and undirected edges A-B, A-C, B-D and C-D. Write out its adjacency matrix.

Key term

What makes a tree binary?

Process

Describe the procedure for inserting a value into a binary search tree.

Key term

The values 50, 30, 70, 20, 40, 60, 80 are inserted in that order into an empty binary search tree. Describe the tree that results.

Key term

How do you delete a node that has exactly one child?

Key term

How do you delete a node that has two children?

Key term

Give three uses of trees.

Key term

Why is deleting from a hash table that uses linear probing more awkward than it looks?

Numbers

How many elements does an array declared as 2 by 3 by 4 hold?

Take Data Structures further

The same content, four other ways.

Commonly confused

Pairs that lose marks when they are blurred together.

  • A stack vs A queue

    A stack: a structure where the last item added is the first one removed. A queue: a structure where the first item added is the first one removed.

  • Stack overflow vs Stack underflow

    Stack overflow: the error raised when something is pushed onto a structure that is already full. Stack underflow: the error raised when something is taken from a structure that is already empty.

  • An array vs A record

    An array: an ordered collection of items of the same type, reached by index. A record: a collection of related fields which may each be of a different type.

Questions from this topic

Each one with the model answer underneath.

  1. 1

    What is an array?

    Model answer

    An ordered, indexed collection of elements that are all of the same data type, held in a block of consecutive memory locations. It has a size fixed when it is created, and each element is reached by its index (position number) rather than by searching for it.

  2. 2

    A one-dimensional array is a row of values. What does a two-dimensional array give you, and how do you get at a single element?

    Model answer

    A two-dimensional array is a table: rows and columns. You reach a single element with two indices, conventionally the row first and the column second, for example grid[2][5] meaning row 2, column 5. It is the natural structure for anything grid-shaped, such as a spreadsheet, a board game, a seating plan or a black-and-white image.

  3. 3

    Describe what a three-dimensional array is and give a use for one.

    Model answer

    A three-dimensional array is effectively a stack of two-dimensional tables, so it needs three indices, for example cube[layer][row][column]. Uses include a three-dimensional game world or voxel model, a colour image where the third index selects the red, green or blue channel, or exam marks stored as [student][subject][term].

  4. 4

    How many elements does an array declared as 2 by 3 by 4 hold?

    Model answer

    24. The sizes of the dimensions multiply: 2 x 3 x 4 = 24 elements.

  5. 5

    Explain why an array can jump straight to element 500 without looking at the other 499.

    Model answer

    Because the elements are all the same size and stored contiguously, the computer can calculate the address of any element arithmetically rather than searching for it: address = base address + index x size of one element. That single calculation gives constant-time random access, which is the array's main strength.

  6. 6

    An array of 4-byte integers begins at address 2000 and is indexed from 0. What is the address of element 6?

    Model answer

    2024. Address = 2000 + (6 x 4) = 2000 + 24 = 2024. Note that if the array were indexed from 1 instead, you would use (6 - 1) x 4, giving 2020 - always check the base index.

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.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram the night before, weakest topic first

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

If it matches, the search .
succeedsfailsrestarts

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 global variable means a variable reachable from anywhere in the program.
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.

Data Structures revision questions

What does Data Structures cover in OCR A-Level Computer Science?
9 subtopics: arrays and records, lists and tuples, and creating, traversing, adding and removing items, linked lists, stacks, queues and circular queues, graphs, trees and binary search trees: structure, insertion and searching, deleting from a binary search tree, traversals, uses of trees and general trees and hash tables. Each one has its own page with questions and model answers.
How is Data Structures organised?
By the OCR H446 specification, subtopic by subtopic, so it matches the order you are taught it in.

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.