【问题标题】:what is the worst and best case run time for insertion sort and merge sort?插入排序和合并排序的最坏和最好的运行时间是多少?
【发布时间】:2019-11-14 22:59:02
【问题描述】:

以下哪些是正确的?插入和合并排序的最坏和最佳情况运行时间?

插入排序(最佳情况):大 O(n) 或 theta (n) (最坏情况):大 O(n^2) 还是 theta (n^2)?

合并排序(最佳情况):大 O(n log n) 或 theta (n log n) (最坏情况):大 O (n log n) 还是 theta (nlog n)?

【问题讨论】:

标签: algorithm sorting


【解决方案1】:

两者都是正确的。祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-27
    • 2021-08-30
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    • 2011-07-04
    • 2017-02-06
    相关资源
    最近更新 更多