
归并排序
文章平均质量分 81
小榕流光
这个作者很懒,什么都没留下…
展开
-
[leetcode] 327. Count of Range Sum 解题报告
题目链接: https://leetcode.com/problems/count-of-range-sum/Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the s原创 2016-05-17 15:33:06 · 8074 阅读 · 1 评论 -
[leetcode] 148. Sort List 解题报告
题目链接:https://leetcode.com/problems/sort-list/Sort a linked list in O(n log n) time using constant space complexity.思路:用快速排序的话一个比较难的问题是不能随机访问链表,而归并排序可以利用递归的性质。归并排序时间复杂度为O(n*log(n)),但是这题要求原创 2016-01-10 12:05:19 · 759 阅读 · 0 评论 -
[leetcode] 315. Count of Smaller Numbers After Self 解题报告
题目链接: https://leetcode.com/problems/count-of-smaller-numbers-after-self/You are given an integer array nums and you have to return a new counts array. The counts array has the property where cou原创 2016-05-05 10:43:51 · 6996 阅读 · 0 评论