2 ms·
I blame an over reliance on Big O as an arbiter of what is a fast algorithm. Linked lists are commonly taught as having much better insertion speed than arrays
by taeric 4y ago
I blame an over reliance on Big O as an arbiter of what is a fast algorithm. Linked lists are commonly taught as having much better insertion speed than arrays.
This ignores constant factors and cache coherency, of course. More, it also ignores that most lists that folks will make have a VERY predictable access pattern. Typically just a one way scan, if any traversal at all. With very few inserts, and mostly just appending.
- Narishma 4y agoCache locality, not coherency.