A. Little Pony and Crystal Mine 模拟题. 用矩阵直接构造或者直接根据关系输出 B. Little Pony and Sort by Shift 模拟题。 通过提供的操作得到的序列只能是两段递增或者整个序列递增。 那么可以求得第一段递增序列长度为0…p 如果整个序列是递...
分类:
其他好文 时间:
2014-08-10 18:31:40
阅读次数:
206
#include #includeusing namespace std;int main( ){ int i,a[10]; for(i=0;i>a[i] ; sort(a,a+10); for(i=0;i#includeusing namespace std;int main( ){ ...
分类:
其他好文 时间:
2014-08-10 18:27:00
阅读次数:
216
#include #includeusing namespace std;int a[5];int main( ){ int i; for(i=0;i>a[i] ; sort(a,a+5); for(i=0;i#includeusing namespace std;int a[5];boo...
分类:
其他好文 时间:
2014-08-10 18:24:00
阅读次数:
199
#include #include using namespace std;int main(){ int i,k,n,a[10000]; cin>>n; for(i=0;i>a[i]; sort(a,a+n); cout#include using name...
分类:
其他好文 时间:
2014-08-10 18:18:30
阅读次数:
162
DSU stands for ‘decorate, sort, undecorate’ and refers to a pattern that is often useful for sorting lists according to some attribute of elements.For...
分类:
其他好文 时间:
2014-08-10 18:03:30
阅读次数:
204
/**
* 冒泡排序
* @author fgtian
*
*/
public class BubleSort {
public static void sort(int[] arr) {
int length = arr.length;
for (int i = 0; i i; j...
分类:
其他好文 时间:
2014-08-10 15:46:20
阅读次数:
165
package data;public class Sort { String endline = System.getProperty("line.separator"); //选择排序 public void selectSort(int[] arr){ int len = arr.leng.....
分类:
其他好文 时间:
2014-08-10 15:23:50
阅读次数:
209
Round 1(Bar Raiser):Complete discussion on my project.Suppose you have a file with billion entries and you have to sort the data of a file according t...
分类:
其他好文 时间:
2014-08-10 08:07:59
阅读次数:
191
说明:归并排序: 时间 O(nlogn),空间 O(1). 每次将链表一分为二, 然后再合并。快排(用两个指针)
说明: 与顺序表不同的时,每次找插入位置时从头开始走。
分类:
其他好文 时间:
2014-08-10 01:40:39
阅读次数:
226
Sort a linked list using insertion sort.思路:若当前元素比head小,插入已排序队列头部;否则,从前往后查找当前元素的插入位置。 1 ListNode *insertionSortList( ListNode *head ) { 2 if( !head...
分类:
其他好文 时间:
2014-08-10 01:30:39
阅读次数:
313