levo

Files, Records and File Organisation

Direct access and hashing algorithms

  • 3 things to know
  • Component 2

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.

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