3 ms·
Due to the physical architecture of CPUs/etc., data structures that have "worse" asymptotic performance are often quite a bit faster than those with "better" pe
by vishbar 6y ago
Due to the physical architecture of CPUs/etc., data structures that have "worse" asymptotic performance are often quite a bit faster than those with "better" performance. For example, iterating through a small array to find an item and test for existence is often quite a bit faster than using a hash set for the same operation.
- eru 6y agoIn the same vein, pre-processing your data via sorting on some carefully chosen keys can sometimes alleviate the need for purpose built data structures. And because of caches, sorting can sometimes beat hashtables.
- dhsysusbsjsi 6y agoWhich is why I just use the standard library.
- eru 6y agoMost languages have more than one data structure in their standard library.