A loose collection of handcrafted Go implementations of common data structures and algorithms for my own reference and for demonstration purposes.
But most importantly this repository is created and maintained to have some fun developing stuff and to stay hungry, stay curious!
The lists below are in no particular order and the various implementations are not guaranteed to be "perfect". Everything is implemented for mere self educational purposes and can very likely be improved on.
Type (Wikipedia link) | Package | Implemented |
---|---|---|
List (Array) | list | - |
Sorted list | sortedlist | - |
Linked list | linkedlist | ✓ |
Queue (FIFO) | queue | ✓ |
Stack (LIFO) | stack | ✓ |
Max heap (Binary heap) | heap/max | - |
Min heap (Pairing heap) | heap/min | - |
Hash table (hashmap) | hashmap | ✓ |
Tree | tree | - |
Trie | trie | - |
Binary search tree | binarytree | - |
B-tree | btree | - |
Undirected graph | graph/undirected | - |
Directed graph | graph/directed | - |
Name (Wikipedia link) | Package | Implemented |
---|---|---|
Quicksort | sort/quick | - |
Bubble sort | sort/bubble | - |
Merge sort | sort/merge | - |
Heapsort | sort/heap | - |
Selection sort | sort/selection | - |
Insertion sort | sort/insertion | - |
Cocktail shaker sort | sort/cocktailshaker | - |
Shellsort | sort/shell | - |
Radix sort | sort/radix | - |
Name (Wikipedia link) | Package | Implemented |
---|---|---|
SHA-256 | hash/sha256 | - |
MD5 | hash/md5 | - |
Pearson hashing | hash/pearson | ✓ |
CRC-32 | hash/crc32 | - |
MurmurHash | hash/murmur | - |
SpookyHash | hash/spooky | - |
Name (Wikipedia link) | Package | Implemented |
---|---|---|
Levenshtein | string/metric/levenshtein | - |
Hamming | string/metric/hamming | - |
N-Gram | string/metric/ngram | - |
Name (Wikipedia link) | Package | Implemented |
---|---|---|
Aho–Corasick | string/search/ahocorasick | - |
Function | Package | Implemented |
---|---|---|
Mix | util | ✓ |
Max | util | ✓ |