Binary search tree over AVL tree

前端 未结 4 1992
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 20:35

As far as I know the time complexity between AVL trees and Binary Search Trees are the same in average case, with AVLs beating BSTs in worst case scenarios. This gives me a

4条回答
  •  一向
    一向 (楼主)
    2020-12-31 21:07

    My assumption is: when you mention BST, you mean a BST without balancing.

    It could be argued that if you need a navigatable data structure and you know your data won't be worst case (sorted) and is somewhat small, a BST (without balance) would be adequate.

    But more than likely that's a rare case.

提交回复
热议问题