3 ms·
there's a constant factor hidden in all of those, and it's not free. a tree can often be slower than a simple array for lookups, even if the tree is O(log n) a
by blibble 12y ago
there's a constant factor hidden in all of those, and it's not free.
a tree can often be slower than a simple array for lookups, even if the tree is O(log n) and the array is O(n).
- FreeFull 12y agoEspecially since the array will probably be linear in memory, so will work well with the cache, and the tree probably will have jumps all over the RAM unless the implementation uses a backing array.