Download presentation
Presentation is loading. Please wait.
Published byYandi Susanto Modified over 6 years ago
1
CS-514 Final Project How circular arrays behave under successive rounds of uniform insertions and deletions Diogo Andrade Gábor Rudolf
2
Experiments Consider a circular array:
Define the number of elements (n). Define the load factor r = n / array size. Define the number of rounds of insertions & deletions (I). Initialize the array with n elements, and then run for I iterations consisting of one insertion and deletion each. The positions for insertion and the deleted elements are selected uniformly.
3
Data generated by experiments
Distribution, average and standard deviation of the number of shifts per iteration Number of clusters Distribution of cluster sizes in the “stationary” state Measure of clustering (sum of the log of gaps)
4
Results: Convergence The number of clusters per iteration and the gap measure converge after some iterations, independent of the array parameters and the how the array is initialized. 3 different initializations: Random One big chunk Successive insertions
5
Results: Convergence
6
Histogram of Shifts and Cluster Sizes
7
Distribution of Shifts
The probability of having to make k shifts after an insertion can be determined by the sizes of the clusters: P[k shifts] = (# clusters with size >= k) / size
8
Approximation by Geometric & Modified Geometric Distribution
9
Results: Dependency on load factor
The number of shifts per iteration and the average number of clusters depend only on the load factor of the array. The gap measure depends on the load factor and on the array size.
10
Results: Shifts - Dependency on load factor
11
Results: gap measure - dependency on load factor and size
12
Hashing with Linear Probing
The experiment models the behavior of a dynamic hash table with open addressing using linear probing. The static case was studied extensively, see for example Knuth, 1963. We compare the long-term behavior with the static case as described by Knuth’s formulas.
13
Comparison with static case
Expected number of shifts for inserting last element in static case (Knuth’s formula) Long-term behavior in our experiment
14
Future Work Proving convergence results
Derive formulas for distribution, average and deviation of shifts Further comparison with Knuth’s results Analyze the time it takes to reach “stationary” state from different initial arrays (most importantly for successive insertions, which correspond to a hash table)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.