masstree
masstree copied to clipboard
A question about unstable state?
I see in your implementation, that unstable state is not a problem, because you put each key as deeper as possible, so each time there is key conflict you can inserting a new layer instead of replacing one.(Am i right?)
This is really clever! In this case key suffix is not needed and we don't have to retry when masstree_get, but at the cost of a bit more memory.
How do you come up with that?
I implement this algorithm lately, and I also did some modification, that new layer is created lazily, eg. a key with length 100 is store in layer 0 if there is no prefix conflict.