题目
Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n2 steps, while merge sort runs in 64
这篇博客探讨了在相同环境下,对于不同大小的输入n,何时插入排序的运行时间(8n^2步)会优于归并排序(64n logn步)。通过求解不等式8n^2 ≤ 64n logn,得出n ≤ 43时,插入排序胜出。博主建议使用Excel来辅助计算和可视化分析不等式解的情况。
Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n2 steps, while merge sort runs in 64

被折叠的 条评论
为什么被折叠?
