CS-514 Final Project How circular arrays behave under successive rounds of uniform insertions and deletions Diogo Andrade Gábor Rudolf.

Slides:



Advertisements
Similar presentations
CS Data Structures Chapter 8 Hashing.
Advertisements

Hashing.
Lecture 6 Hashing. Motivating Example Want to store a list whose elements are integers between 1 and 5 Will define an array of size 5, and if the list.
Lecture 11 oct 6 Goals: hashing hash functions chaining closed hashing application of hashing.
Optimal Fast Hashing Yossi Kanizo (Technion, Israel) Joint work with Isaac Keslassy (Technion, Israel) and David Hay (Hebrew Univ., Israel)
Discrete Probability Distributions
Randomized Algorithms Randomized Algorithms CS648 Lecture 8 Tools for bounding deviation of a random variable Markov’s Inequality Chernoff Bound Lecture.
Hash Tables How well do hash tables support dynamic set operations? Implementations –Direct address –Hash functions Collision resolution methods –Universal.
E.G.M. PetrakisHashing1  Data organization in main memory or disk  sequential, binary trees, …  The location of a key depends on other keys => unnecessary.
Overflow Handling An overflow occurs when the home bucket for a new pair (key, element) is full. We may handle overflows by:  Search the hash table in.
Continuous Random Variables Chap. 12. COMP 5340/6340 Continuous Random Variables2 Preamble Continuous probability distribution are not related to specific.
Tirgul 9 Hash Tables (continued) Reminder Examples.
Introduction to Hashing CS 311 Winter, Dictionary Structure A dictionary structure has the form: (Key, Data) Dictionary structures are organized.
Tirgul 7. Find an efficient implementation of a dynamic collection of elements with unique keys Supported Operations: Insert, Search and Delete. The keys.
CS Data Structures Chapter 8 Hashing (Concentrating on Static Hashing)
Lecture 11 oct 7 Goals: hashing hash functions chaining closed hashing application of hashing.
Hash Tables. Container of elements where each element has an associated key Each key is mapped to a value that determines the table cell where element.
L. Grewe. Computing hash function for a string Horner’s rule: (( … (a 0 x + a 1 ) x + a 2 ) x + … + a n-2 )x + a n-1 ) int hash( const string & key )
Data Structures Hashing Uri Zwick January 2014.
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics, 2007 Instructor Longin Jan Latecki Chapter 7: Expectation and variance.
Hashtables David Kauchak cs302 Spring Administrative Talk today at lunch Midterm must take it by Friday at 6pm No assignment over the break.
Data Structures Hash Tables. Hashing Tables l Motivation: symbol tables n A compiler uses a symbol table to relate symbols to associated data u Symbols:
1 Hashing - Introduction Dictionary = a dynamic set that supports the operations INSERT, DELETE, SEARCH Dictionary = a dynamic set that supports the operations.
Foundations of Data Structures Practical Session #10 Hash Tables.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Average Case Analysis.
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Recurrence Relations Analyzing the performance of recursive algorithms.
1 7.3 RANDOM VARIABLES When the variables in question are quantitative, they are known as random variables. A random variable, X, is a quantitative variable.
Hashtables David Kauchak cs302 Spring Administrative Midterm must take it by Friday at 6pm No assignment over the break.
Hashing TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA Course: Data Structures Lecturer: Haim Kaplan and Uri Zwick.
Hashing Goal Perform inserts, deletes, and finds in constant average time Topics Hash table, hash function, collisions Collision handling Separate chaining.
CSC 413/513: Intro to Algorithms Hash Tables. ● Hash table: ■ Given a table T and a record x, with key (= symbol) and satellite data, we need to support:
Prof. Amr Goneid, AUC1 CSCI 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 5. Dictionaries(2): Hash Tables.
Sets and Maps Chapter 9.
Sections 10.5 – 10.6 Hashing.
Random Variables and Probability Distribution (2)
Hashing, Hash Function, Collision & Deletion
Hash table CSC317 We have elements with key and satellite data
CSCI 210 Data Structures and Algorithms
CS 332: Algorithms Hash Tables David Luebke /19/2018.
Hashing - resolving collisions
Hashing Alexandra Stefan.
EEE2108: Programming for Engineers Chapter 8. Hashing
Hashing Alexandra Stefan.
Advanced Associative Structures
Hash Table.
Chapter 28 Hashing.
Instructor: Lilian de Greef Quarter: Summer 2017
Hash In-Class Quiz.
תרגול 8 Hash Tables ds162-ps08 11/23/2018.
CS 3343: Analysis of Algorithms
Chapter 21 Hashing: Implementing Dictionaries and Sets
Dictionaries and Their Implementations
Resolving collisions: Open addressing
CSCE 3110 Data Structures & Algorithm Analysis
Analyzing an Algorithm Computing the Order of Magnitude Big O Notation
CS202 - Fundamental Structures of Computer Science II
2018, Spring Pusan National University Ki-Joune Li
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Space-for-time tradeoffs
Tree traversal preorder, postorder: applies to any kind of tree
Sets and Maps Chapter 9.
Pseudorandom number, Universal Hashing, Chaining and Linear-Probing
CS 5243: Algorithms Hash Tables.
Podcast Ch21f Title: HashSet Class
DATA STRUCTURES-COLLISION TECHNIQUES
17CS1102 DATA STRUCTURES © 2018 KLEF – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED.
Lecture-Hashing.
Presentation transcript:

CS-514 Final Project How circular arrays behave under successive rounds of uniform insertions and deletions Diogo Andrade Gábor Rudolf

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.

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)

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

Results: Convergence

Histogram of Shifts and Cluster Sizes

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

Approximation by Geometric & Modified Geometric Distribution

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.

Results: Shifts - Dependency on load factor

Results: gap measure - dependency on load factor and size

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.

Comparison with static case Expected number of shifts for inserting last element in static case (Knuth’s formula) Long-term behavior in our experiment

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)