![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
归并排序
文章平均质量分 85
忧伤的肚腩
华中科技大学计算机专业在读
展开
-
链表排序
题目链接 题目描述 Sort a linked list in O(n log n) time using constant space complexity. 要求的时间复杂度为O(nlogn), 因此时间 Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: In原创 2018-10-01 20:14:29 · 227 阅读 · 0 评论 -
493. Reverse Pairs
主要是归并排序中的关键思想情况 如何设计归并排序merger(int []nums, int lstart, int lend, int rstart, int rend){ 注意lstart 到lend 是有序的情况 , rstart 到rend 也是有序的情况 } 如果 lstart 大于 rstart的话,那么lstart 到lend 都是要比rstart 大的数,(在这个时候进行统计计数...原创 2018-11-24 13:08:18 · 213 阅读 · 0 评论