Back to marketplace

Chapter 37 - Hash tables

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

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

Card preview (24)

#1
Front (Question)

Why are hash tables useful?

Back (Answer)

» Can quickly access data without having to look at all the records

#2
Front (Question)

What does a hashing algorithm do?

Back (Answer)

» Divide the key by the number of available address and take the remainder as the address

#3
Front (Question)

What happens when there is a synonym?

Back (Answer)

» When 2 pieces of data hash to the same address, this cause a collision

#4
Front (Question)

What is the simplest way of dealing with a collision?

Back (Answer)

» Is to store the item in the next available space, assuming it is free

#5
Front (Question)

What is a hash table?

Back (Answer)

» Abstract data structure where data is stored in an array format and enables access to structures that are not stored in a structured manner

#6
Front (Question)

What is the purpose of a hash function?

Back (Answer)

» Generates an address in a table for the data that can calculate the position of an item in the table

#7
Front (Question)

What is a collision?

Back (Answer)

» When a hashing algorithm maps 2 different keys to the same table address

#8
Front (Question)

What is the mid-square method?

Back (Answer)

» Square the item » Extract the middle 2 digits » Mod the value by the table size to get an address

#9
Front (Question)

What is the folding method?

Back (Answer)

» Divides the item into equal parts » Add the pieces together » Mod the value by the table size to get an address

#10
Front (Question)

What is a dictionary?

Back (Answer)

» An abstract data type composed of a collection of pairs such that each possible key appears at most once in the collection

#11
Front (Question)

How is it possible to hash a string?

Back (Answer)

» By using the ASCII code for each character » Add the ASCII value for each character » MOD the value by the table size

#12
Front (Question)

What are the consequences of having a fuller hash table?

Back (Answer)

» More likely it is that there will be collision

#13
Front (Question)

What is rehashing?

Back (Answer)

» Name given to the process of finding an empty slot when a collision has occurred » Finding an alternative position for items in the hash table

#14
Front (Question)

What does each pair consist of in a dictionary?

Back (Answer)

» Key » Value

#15
Front (Question)

What are the 3 good features of a hashing function?

Back (Answer)

» Be calculated quickly » Result in as few collisions as possible » Use as little memory as possible

#16
Front (Question)

What is linear probing?

Back (Answer)

» To find the item later that has been moved due to a collision » The hashing function delivers the start position from which a linear search can then be applied until the item is found

#17
Front (Question)

What is the disadvantage of linear probing?

Back (Answer)

» It prevents other items from being stored at their correct location in the hash table

#18
Front (Question)

What is clustering?

Back (Answer)

» Several positions being filled around the common collision values

#19
Front (Question)

What is the trade off in a hashing algorithm?

Back (Answer)

» Between the efficiency of the algorithm and the size of the hash table

#20
Front (Question)

What is an alternative method of handling collisions ? Hint - uses a dimensional array

Back (Answer)

» Uses 2D array

#21
Front (Question)

What is chaining?

Back (Answer)

» The possibility of more than one item to be placed at the same position

#22
Front (Question)

What is the purpose of an overflow table?

Back (Answer)

» Store the collisions in which items can be searched sequentially

#23
Front (Question)

What are the common situations in which has tables can be used?

Back (Answer)

» File systems linking a file name » Identifying the keywords in a programming language

#24
Front (Question)

What are the 3 operations that are possible on a has table?

Back (Answer)

» Add » Delete » Retrieve - retrieves an item using its hash value