github.com/scottcagno/storage@v1.8.0/pkg/hashmap/openaddr/details.go (about)

     1  package openaddr
     2  
     3  /*
     4  	This hash map implementation uses a closed hashing (open addressing) technique with
     5  	linear probing for resolving any hash collisions. The exact algorithm it utilizes
     6  	is called 'robin hood hashing.' More information about this can technique can be found
     7  	in the links provided below:
     8  	01) https://andre.arko.net/2017/08/24/robin-hood-hashing/
     9  	02) https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf
    10  	03) https://www.dmtcs.org/pdfpapers/dmAD0127.pdf
    11  	04) https://www.pvk.ca/Blog/numerical_experiments_in_hashing.html
    12  	05) https://www.pvk.ca/Blog/more_numerical_experiments_in_hashing.html
    13  	06) https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/
    14  	07) https://www.sebastiansylvan.com/post/more-on-robin-hood-hashing-2/
    15  	08) http://codecapsule.com/2013/11/11/robin-hood-hashing/
    16  	09) https://www.pvk.ca/Blog/2013/11/26/the-other-robin-hood-hashing/
    17  	10) http://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/
    18  	The basic principal is:
    19  	-----------------------
    20  	1) Calculate the hash value and initial index of the entry to be inserted
    21  	2) Search the position in the array linearly
    22  	3) While searching, the distance from initial index is kept which is called DIB(Distance from Initial Bucket)
    23  	4) If we can find the empty bucket, we can insert the entry with DIB here
    24  	5) If we encounter a entry which has less DIB than the one of the entry to be inserted, swap them.
    25  */