Below is an example of a simple implementation of an open addressing hash table using linear probing in Python to store a list of integers. \
python
class OpenAddressingHashTable:
def __init__(self, size):
self.size = size
self.table = [None] * size
def hash_function(self, key):
return key % self.size
def linear_probe(self, index, attempt):
return (index + attempt) % self.size
def insert(self, key):
index = self.hash_function(key)
attempt = 0
while self.table[index] is not None:
attempt += 1
index = self.linear_probe(index, attempt)
self.table[index] = key
def search(self, key):
index = self.hash_function(key)
attempt = 0
while self.table[index] is not None:
if self.table[index] == key:
return index
attempt += 1
index = self.linear_probe(index, attempt)
return None
def delete(self, key):
index = self.search(key)
if index is not None:
self.table[index] = None
print(f"Key {key} deleted.")
else:
print(f"Key {key} not found.")
can customize the size of the hash table (size parameter) and the hash function based on your requirements.