Skip to content

Instantly share code, notes, and snippets.

@Israel025
Last active April 8, 2019 19:38
Show Gist options
  • Save Israel025/225f79745a88ff12f17ab55a98ef6e12 to your computer and use it in GitHub Desktop.
Save Israel025/225f79745a88ff12f17ab55a98ef6e12 to your computer and use it in GitHub Desktop.
A function to find the duplicates in an array using a hash table
// A hash table data structure helps to quickly find/compute data by using keys that are mapped to array
// positions by hash functions. values are stored and referenced by memory locations
// A hash table data structure is fast because its time complexity is O(1)
// (it only tranverse through an array once for each instance of an operation )
// I'm not sure but i think in JavaScript, addressing an array using string indexing makes
// the array a hash table data structure
//IMPLEMENTATION STILL IN PROGRESS (cant figure it out very well yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment