A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Why does CLRS favor red-black trees over AVL trees?

Best Answers

Historically red-black trees were preferred because they perform slightly fewer rotations on insert at the expense of slightly less rigid balance constraints and it was ASSUMED that made them better in most cases. read more

CLRS may have been correct to favor red-black trees if memory access is costly making random inserts faster due to slightly fewer rotations; however, AVL trees perform better when inserts are not random. read more

AVL trees are more rigidly balanced and hence provide faster look-ups. Thus for a look-up intensive task use an AVL tree. For an insert intensive tasks, use a Red-Black tree. AVL trees store the balance factor at each node. This takes O(N) extra space. read more

1. AVL trees are more balanced than red black trees so if the task is regarding faster look-ups then it is advisable to use AVL trees.The constant for lookup in AVL is 1.5 (so 1.5 log). Red-Black trees have a constant of 2 (so 2*log(n)) for a lookup. Advantages of using RBT: Deletions are cheaper in RBT than in AVL. read more

Encyclopedia Research

Wikipedia: