Back to marketplace

Hash tables

No description yet. This curated deck is ready for daily study.

Total cards: 12•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (12)

#1
Front (Question)

Define Hash table

Back (Answer)

A data structure that implements an associative array (dictionary)

#2
Front (Question)

How is data stored in an associative array?

Back (Answer)

As a collection of key-value pairs

#3
Front (Question)

What is hashing?

Back (Answer)

The position of the data within the array is determined by applying a hashing algorithm to the key

#4
Front (Question)

What is the hashing algorithm called?

Back (Answer)

A hash function

#5
Front (Question)

Pros of hash tables

Back (Answer)

Enable efficient searching Maintaining data in a hash table is very efficient

#6
Front (Question)

Why must you use an array to implement hash tables?

Back (Answer)

So you can access each position of the array directly by specifying the index of the position

#7
Front (Question)

What are the positions within an array called?

Back (Answer)

Buckets

#8
Front (Question)

What’s a bucket?

Back (Answer)

A single piece of data or complex data object stored alongside a key

#9
Front (Question)

Load factor =

Back (Answer)

N (number of occupied buckets) / K (Number of buckets)

#10
Front (Question)

What is the optimal load factor?

Back (Answer)

0.75

#11
Front (Question)

What are the main requirements of a hash function?

Back (Answer)

Always produces the same hash value for the same key Provides a uniform distribution of hash values- every value has an equal chance of being generated Minimises clustering- keys don’t produce the same hash value Be fast to compute

#12
Front (Question)

Define a collision

Back (Answer)

When 2 or more different keys produce the same hash value