🤖 AI Summary
Red-black trees (RBTs) are widely assumed to outperform AVL trees in dynamic dictionary operations, particularly due to perceived lower deletion overhead. Method: This work conducts a systematic empirical comparison of AVL trees against three RBT variants—standard, left-leaning, and relaxed—across insertion, deletion, and lookup operations, combining theoretical analysis with large-scale microbenchmarks. Contribution/Results: Contrary to conventional wisdom, AVL trees exhibit significantly faster deletions (15–30% improvement on average), competitive or superior insertion performance, and negligible lookup overhead—all while maintaining O(log n) asymptotic complexity. A key contribution is an optimized AVL deletion algorithm that reduces rebalancing steps by ~20%, directly mitigating the historical perception of high deletion cost. These findings empirically challenge the heuristic preference for RBTs in dynamic balanced BST applications and provide both evidence-based guidance and concrete algorithmic improvements for BST selection and optimization.
📝 Abstract
Although historical opinion has held that the red-black tree is faster than the AVL tree, benchmarks reveal that the AVL tree is faster than the red-black tree for deletion, often faster for insertion, and as fast or faster for search. Both trees achieve $ Oleft( log n
ight ) $ insertion, deletion, and search by rebalancing in association with insertion and deletion. An improved AVL tree deletion algorithm reduces the rebalancing operations associated with deletion by 20 percent.