
归并-快排
文章平均质量分 58
Violet-Guo
努力一直前进的程序猿一枚~~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用快排和归并求解逆序对
The attached file Q8.txt contains 100,000 integers between 1 and 100,000 (each row has a single integer), the order of these integers is random and no integer is repeated.Write a program to implement原创 2017-12-22 11:07:45 · 1911 阅读 · 1 评论 -
【Leetcode】Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampleGiven [3,2,1,5,6,4] and k = 2, return 5.Note: You原创 2017-12-28 15:46:28 · 571 阅读 · 0 评论 -
Finding the number of inversions
Recall the problem of finding the number of inversions. As in the course, we are given a sequence of n numbers a 1 ,··· ,a n , which we assume are all distinct, and we difine an inversion to be a pair原创 2017-12-28 16:04:37 · 2647 阅读 · 0 评论