Skip to content
On this page

归并排序

将一个长度为n的数组,递归地分成两半分别排序,然后将结果归并起来。

时间复杂度:O(nlogn) 空间复杂度:O(n)

代码