Tutorial :Are AVL Trees Evil? [closed]


I was reading the article from Steve Yegge about singletons. In it he mentions his teacher told him AVL Trees were evil. Is it just that red and black trees are a better solution?


Evil from what point of view?

Like always: there are no bad tools, only bad craftsmen.

In my memory, AVL trees have slower insertion/removal but faster retrieval than Red/black. Mainly because of the balance algorithm.


No, AVL trees are certainly not evil in any respect. They are a completely valid self balancing tree structure. They have different performance characteristics than Red-Black trees certainly and typically these differences lead to people choosing a red-black tree over an AVL tree. But this does not make them evil.


I'm sure that AVL trees are evil in the same way that GOTO is evil or BUBBLE SORT is evil.

Algorithms aren't evil, but algorithms also don't jump up and down to tell you when they are appropriate either.


Here's a lot of info about the differences between Red-Black and AVL-Trees:


and a paper comparing the different structures:


In short - AVL is faster to search, Red-Black faster to insert.


Splay Trees are much cooler. :)


No, they aren't evil, only a bit tricky to program.

AVL Trees http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx

Red Black tree link from there too.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »