Cuckoo-Hashing

Implementation of data structures and algorithms
Fall 2018
Short Project 7: Comparison of hashing implementations

Authors - Team SP7 2

  • Prateek Sarna (pxs180012)
  • Bharath Rudra (bxr180008)

Files Included

  • Cuckoo.java
  • PartOne.java
  • PartTwo.java
  • Timer.java

Task

  • Part One

    • Implement Cuckoo Hashing and compare its performance with Java's HashMap/HashSet on millions of operations: add, contains, and remove.
  • Part Two

    • Generate an array of random integers, and calculate how many distinct numbers it has: static int distinctElements(T[ ] arr) { ... } Compare running times of HashSet and your hashing implementation, for large n.

Navigation Inisde the Program

  • For PartOne:

    • Once you run the program, enter 'Add (value)' into the console to add to the respective hash tables 'Contains (value)' to check if value is present 'Remove (value) to remove the value
  • For PartTwo:

    • Size can be passed as a parameter when you run the program to specify size of n. If size is not provided, the default value would be 10000.