Back to Topic 8.1 — Fundamentals of ADTs
8.1.6Computer Science HL5 flashcards

Core principles of ADTs

Practice Flashcards

Flip to reveal answers
Card 1 of 58.1.6
8.1.6
Question

How does a hash table locate a value?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Core principles of ADTs

Sign up free to track progress and get spaced-repetition review schedules.

Card 1process

Question

How does a hash table locate a value?

Answer

It runs the key through a **hash function**, takes the result **modulo the table size**, and goes straight to that bucket. The address is computed, not searched for.

Card 2definition

Question

What three properties must a hash function have?

Answer

**Deterministic** (same key, same bucket, always), **fast** (it runs on every operation) and **uniform** (keys spread evenly).

Card 3concept

Question

Why are collisions inevitable?

Answer

There are more possible keys than buckets, so two keys must eventually map to the same one. It is a counting argument, not a defect.

Card 4comparison

Question

Chaining or open addressing — what is the difference?

Answer

**Chaining** stores colliding keys in a list inside the bucket. **Open addressing** puts them in the next free bucket, so the table can never hold more items than buckets.

Card 5concept

Question

What is a hash table's complexity?

Answer

**O(1) on average, O(n) in the worst case** — the worst case being a hash function that clusters every key into one bucket.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free
IB Computer Science Core principles of ADTs Flashcards | 8.1.6 | Aimnova