For small data :
insert : the RB tree and the avl tree have a constant maximum rotation number, but the RB tree will be faster because on average the RB tree uses less rotation.
search : the AVL tree is faster because the AVL tree has less depth.
delete . The RB tree has a constant maximum rotation number, but the AVL tree can have O (log N) times the rotation as the worst. and on average, the RB tree also has fewer revolutions, so the RB tree is faster.
for big data :
insert : AVL tree is faster. because before inserting you need to find a specific node. since you have more data, the time difference when searching for a particular node grows proportionally to O (log N). but the AVL tree and RB tree still need a constant number of rotations in the worst case. Thus, the neck of the bottle will become the time when you look for this particular node.
Search : AVL tree is faster. (same as with small data)
delete : the AVL tree is on average faster, but in the worst case, the RB tree is faster. because you also need to look for a very deep node to swap before deleting (similar to the reason for insertion). on average, both trees have a constant number of rotations. but the RB tree has a constant upper bound for rotation.
DU Jiaen Mar 04 '15 at 4:11 2015-03-04 04:11
source share