3 ms·
Word to the wise: if you are tempted to code a red-black tree, it probably means you are using the wrong language. In a more capable language, that code has al
by ncmncm 7y ago
Word to the wise: if you are tempted to code a red-black tree, it probably means you are using the wrong language.
In a more capable language, that code has already been written and put in a library, and been very thoroughly tested and optimized already, and is faster than you could afford to do just now. Less capable languages can't express such a library in usable form, or call into one.
It is not an accident that Linux and BSD kernels have numerous hand-specialized red-black trees in them, now languishing for the attention that is needed to modernize them to perform reasonably on current hardware.