Difference between red-black trees and AVL trees
问题 Can someone please explain what the main differences between these two data structures are? I've been trying to find a source online that highlights the differences/similarities, but I haven't found anything too informative. In what cases would one be preferred over the other? What practical situations make one "better" to use than the other? 回答1: AVL trees maintain a more rigid balance than red-black trees. The path from the root to the deepest leaf in an AVL tree is at most ~1.44 lg(n+2),