Back to marketplace

Section 7 Chapter 40 - Hash Tables and Dictionaries

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

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

Card preview (9)

#1
Front (Question)

Hash Table

Back (Answer)

A data structure that creates a mapping between keys and values. The location of where an item is stored is determined by the hashing algorithm.

#2
Front (Question)

Hashing Algorithm

Back (Answer)

A process that determines the location of a value based on its key. For instance taking modulo of the key if it were an integer

#3
Front (Question)

Folding method

Back (Answer)

A hashing algorithm. Every pair of numbers is added together and then moduloed. For insance: 123456 12 + 34 + 56 102 % 10 2

#4
Front (Question)

How to hash a string

Back (Answer)

The ASCII values of each character are summed together and then a numerical hashing algorithm, for instance modulo, is used to obtain the hash.

#5
Front (Question)

Process for searching for an item in a hash table

Back (Answer)

1) Apply the hashing algorithm to the key 2) If the item is there then return it 3) If the cell is empty it is not in the table 4) If the item is a different one then move forward to the next cell and repeat from (2)

#6
Front (Question)

Collision

Back (Answer)

A collision occurs when two key values compute to the same hash

#7
Front (Question)

Collision resolution

Back (Answer)

Rehashing is used. This is the process of finding an empty slot when a collision has occurred. The most simple rehash is to move forward one cell at a time until an empty one is found

#8
Front (Question)

Dictionary

Back (Answer)

An abstract data type that is a collection of key-value pairs in which the value is accessed via the associated key

#9
Front (Question)

How hash tables and dictionaries are related

Back (Answer)

Dictionaries often use hash tables in their implementation in order to provide faster response times for returning values