This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import random | |
| # Simulation Parameters | |
| table_size = 10000 # Hash table capacity | |
| n_trials = 1000 # Number of search operations per load factor | |
| load_factors = np.linspace(0.1, 0.95, 10) # True load factors from 10% to 95% | |
| # Hash function (simple multiplication method) |