I am wondering how Tarjan's Top-Down red black tree algorithm fares against other red black tree algorithms (e.g. the one by Robert Sedgewick). Has anyone compared the results of various top-down and bottom-up algorithms? Please let me know as it would help in deciding which algorithm I need to have as the base algorithm as I plan to make it concurrent later on. (I would like a comparison not just between top-down vs. bottom-up but also between the various algorithms by these researchers as well!)
1 Answers
From what I could find, there have been little work in this area. There are some performance tests that have been ran between different balanced BST (AVL vs RB vs splay), but to my knowledge, those ran for variants of red-black trees are anecdotal: benchmark of one variant of RB tree against the "standard" implementation on one specific case.
So, if you're decided to implement a red-black tree, you should select a few variants, a language and benchmark them according to your use cases. You can find some open source implementations of different kinds of red-black trees across the net, here are a few main flavors that I'm aware of:
- Left-Leaning RB Tree - Java - GPLv3 - (Sedgewick/Wayne)
- Recursive BU insert/delete, iterative TD insert/delete - C - MIT-like - (eternallyconfuzzled)
- Recursive BU insert, recursive TD delete - Java - MIT - (me)
Those implementation are space efficient because they all have the common point of not using parent pointer. However, you should benchmark them properly, and optimize them if needed.

- 1
- 1

- 11,380
- 1
- 17
- 28
-
Thanks! Can you explain why parent pointers would be a problem? – Shreyas Gokhale May 28 '16 at 13:56
-
If you need to be as space-efficient as possible, then they are a problem. If you look for efficiency, then you should compare the implementations I pointed you to with some using parent pointers. There is no problem with parent pointers. – T. Claverie May 28 '16 at 15:08
-
Understood! I think I will still go with parent pointers because it will make things easier to implement otherwise, I can end up making mistakes in implementing recursion and really mess up the program! – Shreyas Gokhale May 28 '16 at 22:00
-
Also, (I know I shouldn't ask this, but) can you vote for my question if you think it is a good enough question.. I've recently started using stackoverflow and it would help me earn my next badge (Student badge - earned with a question with score of 1 or more).. And thanks again for your help! I've already accepted your answer above! – Shreyas Gokhale May 28 '16 at 22:06