Hash Table & Collision Resolution Simulator
Hash tables map keys to array slots in O(1) expected time via a hash function h(k), using open addressing or separate chaining to resolve collisions as load factor alpha grows.
Technical Reference & Equations
- Table Load Factor:
\alpha = \frac{n}{m}(n: stored keys, m: bucket slots; open addressing requires alpha < 1 (typically <= 0.7).) - Open Addressing Probe Sequences:
h(k, i) = \big(h_1(k) + c_1 i + c_2 i^2\big) \bmod m, \quad h_{\text{dbl}}(k, i) = \big(h_1(k) + i \cdot h_2(k)\big) \bmod m(Linear uses c1=1, c2=0; double hashing eliminates primary and secondary clustering.) - Expected Unsuccessful Probes (Uniform Hashing):
E[\text{probes}_{\text{open}}] \approx \frac{1}{1 - \alpha}, \quad E[\text{probes}_{\text{chain}}] = 1 + \alpha(Open addressing probe counts spike steeply as alpha approaches 1.)
View full Data Structures & Algorithms Formula Sheet | Constants Table
Related Data Structures Calculators
- AVL Self-Balancing Tree & Rotations: Insert and delete keys with live per-node balance factors, heights, automatic LL/RR/LR/RL rotations, and a step-by-step rotation audit log.
- Binary Heap & Priority Queue: Synchronize Min-Heap and Max-Heap binary trees with their 0-indexed backing arrays, Sift-Up/Sift-Down paths, Extract-Root, and Floyd O(n) Build-Heap.
- B+ Tree Index & Range Scan Visualizer: Insert keys into order m=3/4/5 B+ Trees to inspect internal/leaf splits, linked leaf sibling pointers, and SQL range query disk I/O cost.
- Modular Arithmetic & Euclidean GCD: Modular exponentiation, multiplicative inverses, and step-by-step Euclidean algorithm traces.
- Big-O Growth Comparator: Compare asymptotic complexity curves and estimated wall-clock runtimes across input sizes.
- Sorting Algorithm Visualizer: Step through Quick, Merge, Insertion, Selection, and Bubble Sort with comparison and swap counters.