...

/

A Quick Overview of Hash Tables

A Quick Overview of Hash Tables

Let's combine all the different operations discussed previously and test out the functionality of our complete hash table class.

We'll cover the following...

Complete Implementation

In the previous lessons, we discussed each aspect of a hash table in detail. Below, you can find the complete hash table class.

Press + to interact
main.py
HashTable.py
HashEntry.py
from HashTable import HashTable
table = HashTable() # Create a HashTable
print(table.is_empty())
table.insert("This", 1)
table.insert("is", 2)
table.insert("a", 3)
table.insert("Test", 4)
table.insert("Driver", 5)
print("Table Size: " + str(table.get_size()))
print("The value for 'is' key: " + str(table.search("is")))
table.delete("is")
table.delete("a")
print("Table Size: " + str(table.get_size()))

The Set class and dict ...