Youtube (This is very basic implementation). Check Ketama for real implementation. Assume we have 3 memcached servers and want to add a fourth. The continuum approach will invalidate 1/4 or 25% of your keys. The modulo approach will invalidate 3/4 or 75% of your keys. Article 1 (Consistent Hashing in memcache-client) - Gives a very clean and… Continue reading Consistence Hashing
Tag: Hashing
Hashing | Set 1
InterviewBit , GeeksForGeek , LeetCode HashMap Basic Operations Iterator Map<Integer, Integer> dataSet = new HashMap<>(); dataSet.get(), dataSet.put(), dataSet.size() dataSet.containsKey(), dataSet.remove(x); for (Map.Entry<Integer,Integer> entry: dataSet.entrySet()) entry.getKey(), entry.getValue() HashSet - Set<Integer> set = new HashSet<>(); set.contains(), set.add(), set.remove() **** Design a data structure that… Continue reading Hashing | Set 1
Hashing – Theory
*** Implement HashTable in Java Resource: *MIT Video Lecture - Hashing with Chaining MIT Video - Table Doubling, Karp-Rabin Open addressing, cryptographic hashing Hashmap best and average case for Search, Insert and Delete is O(1) and worst case is O(n). Link HashMap get/put complexity - It's usually O(1), with a decent hash which itself is constant time. In the worst… Continue reading Hashing – Theory
You must be logged in to post a comment.