Using red black trees for sorting

前端 未结 6 1427
借酒劲吻你
借酒劲吻你 2020-12-30 04:35

The worst-case running time of insertion on a red-black tree is O(lg n) and if I perform a in-order walk on the tree, I essentially vi

6条回答
  •  佛祖请我去吃肉
    2020-12-30 05:20

    Generally, representations of O(nlgn) algorithms can be expanded to A*nlgn + B where A and B are constants. There are many algorithmic proofs that show the coefficients for quicksort are smaller than those of other algorithms. That is in best-case (quick sort performs horribly on sorted data).

提交回复
热议问题