Lazy insertion in Hash array mapped trie
Aug 22, 2023
Instead of traverse and create node until reach a leaf node in the trie, you can simply just add the value in the first newly created node.
But for each node you should check if current node has the same hash, if yes append the value in that node, else continue.
This could be a good improvement for small amount of insertions.
Implementation: https://github.com/lorenzotinfena/goji/blob/main/collections/trie/hamt.go