What is Nostr?
Per Vognsen /
npub152t…v7uc
2024-05-16 19:57:37

Per Vognsen on Nostr: PSA: If you construct a B-tree with splitting-based inserts then constructing the ...

PSA: If you construct a B-tree with splitting-based inserts then constructing the tree from items in key-sorted order is actually the worst case for packing efficiency. Every node/leaf ends up exactly 50% full except for the right spine. When you bulk-construct a tree from scratch from sorted items, you want to do the construction bottom up and you don't want to use splits. That's linear time and yields an optimally packed tree (everything full excerpt for a partially packed right spine).
Author Public Key
npub152ta9mm2x6nk4ffyrn7ycz444vf7x743t24yddyd40vvcwkw39wqv3v7uc