4 ms·
What's the advantage of using wider trees at every level? Asymptotically wouldn't you get the same behaviour with a binary tree?
by freefrag 11y ago
What's the advantage of using wider trees at every level? Asymptotically wouldn't you get the same behaviour with a binary tree?
- aweinstock 11y agoHigher branching factor gets you a better constant factor because the depth of the tree is the base-(branching factor) logarithm of the number of nodes. The number of pointers you need to follow to reach a leaf is equal to the depth of the tree, and pointer-dereferences are likely to cause a cache miss, which is a relatively slow operation. You're correct that asymptotically, it's the same thing.
- hit9 11y agoAdvantage: constant level time complexity with better space utilization. The binary tree with the binary-search searching strategy has a time complexity O(logN), which is higher than htree's. This htree is mainly for memory bounded cases.