2 ms·
Your dismissal of “sorted flat thing” as being necessarily not online is incorrect or unnecessarily strict to your detriment. I wrote this comparing the high-l
by ComputerGuru 7y ago
Your dismissal of “sorted flat thing” as being necessarily not online is incorrect or unnecessarily strict to your detriment.
I wrote this comparing the high-level performance of a “set” (AVL or red-black tree) against just that:
Faster lookups, insertions, and in-order traversal than a red-black or AVL tree [0]
[0]: https://neosmart.net/blog/2019/sorted-list-vs-binary-search-tree/ https://neosmart.net/blog/2019/sorted-list-vs-binary-search-...
(Spoiler: it depends on the nature of your data, but sorted vector can be dramatically faster.)
- Ericson2314 7y agoTo be clear I am not against "small sorted flat thing" is an optimization for smaller data structures. My point is I care about the map or set interface. I don't use temporary sets or quicksort to sort....because I don't sort---I don't want a list/array of things in order, basically ever.
- ComputerGuru 7y agoYes, and what I showed you is a set with a set interface, internally implemented as an always-sorted list.
- Ericson2314 7y agoOK sorry, Yes creating a map/set using the small-size optimization is internally doing a sort.