Why a programmer would prefer O(N^3) instead of O(N^2)

前端 未结 7 1525
面向向阳花
面向向阳花 2021-01-07 16:57

I was studying for my final exam and there is a question in the archive that I cannot find its answer:

The order-of-growth of the running time of one

相关标签:
7条回答
  • 2021-01-07 17:36

    Big-O is an upper bound on the worst case. QuickSort is O(n^2) time and MergeSort is O(n lgn) time. But people use QuickSort because on average it is O(n lgn) with lower constants than MergseSort.

    0 讨论(0)
提交回复
热议问题