holy hell python doesnt even have a built in red-black tree implementation, just a hashmap style Dict... There is a third party implementation but the best one is something like 8 months since the last release and the repo only has 6 commits...
How do people even survive in #python?
@kirschwipfel I fail to see how lacking fundemental tools that not just improve performance but reduce the complexity of your own code somehow makes life easier.
@kirschwipfel hashtrees are only O(1) when looking up a specific value, they are far less efficient when you wish to traverse the keys of a hashmap in sorted order or to ask "which key comes after key X in the sort order"
Hashmaps are, and should be, the prefered choice when they suit the task. I am not implying we should have tree maps and not hash maps, that would be just as harmful.. but a good programmer (one who wants to keep their code efficient and minimal in complexity) needs both and both are used in different situations, and each is significantly more performant in their respective applications.
@freemo I agree their might be use-cases where a tree actually makes sense.
Please check out some of the many (AVL) tree packages at PyPi. I'm quite confident there are well-maintained ones.
@kirschwipfel Thank you! when i come around again and am ready to address this issue (I shelved it for a much simpler approach that is 90% as good) I certainly will. Good to know they are out there.
@freemo
Can't see how red-black trees improve performance here: dicts are O(1), for red-black trees it is O(log n).
Can't see how a tree reduces complexity of my code. In fact (beside performance) I don't want to care about the datastructure used. Just put elements in and get them out. Whether tree or dict: I would the interface expect to be the same.
Anyhow: Algorithms never belong to the language, but to the library.