levo

Files, Records and File Organisation

Direct access and hashing algorithms

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

Overview

Direct file access and hashing algorithm.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is direct file access?

Key term

What is a hashing algorithm?

Key term

Describe a simple modulo hashing algorithm.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is direct file access?

    Model answer

    Direct access calculates the storage address of a record from its key. Any record can then be reached in one operation, whatever its position.

  2. 2

    What is a hashing algorithm?

    Model answer

    A hashing algorithm is a calculation that turns a record key into a storage address. The same key always produces the same address, so the record can be found again.

  3. 3

    Describe a simple modulo hashing algorithm.

    Model answer

    The key is divided by the number of available addresses and the remainder is taken. A key of 3,127 with 1,000 addresses hashes to address 127.

  4. 4

    Why is a prime number often used as the divisor in a modulo hash?

    Model answer

    A prime divisor spreads keys more evenly, because it shares fewer factors with patterned key values. Clustering at a few addresses is therefore reduced.

  5. 5

    What is a collision?

    Model answer

    A collision happens when two different keys hash to the same address. Only one record can occupy the address, so the second must be placed elsewhere.

  6. 6

    Give two properties of a good hashing algorithm.

    Model answer

    A good algorithm spreads keys evenly across the whole address space. The calculation must also be fast, because it runs on every access.

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 Files, Records and File Organisation, 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.