15.Sort List--链表在O(nlogn),常数空间内完成排序关键点:中间分裂链表,采用双指针归并排序 中间分裂链表的方法:快慢指针,快指针走两步,这样就可以找到中间的了C++:http://blog.csdn.net/jiadebin890724/article/details/213.....
分类:
其他好文 时间:
2014-08-06 01:33:30
阅读次数:
232
//冒泡排序 #include #define N 100 void sort(int n,int a[]) { int i,j,t ; for(i=0;ia[j+1]) { t=a[j] ;a[j]=a[j+1] ;a[j+1]=t ;} } int main ( )...
分类:
其他好文 时间:
2014-08-06 01:19:31
阅读次数:
338
#include int partition(int A[], int p, int q) { int x = A[p]; int i = p; int j; for (j=p+1; jint quick_sort(int a[], int low, int high)//一...
分类:
其他好文 时间:
2014-08-05 22:23:40
阅读次数:
289
珠排序(Bead sort) — O(n) or O(√n),在排序的世界里 珠排序属于不实用的排序算法排序 原因是珠排序和硬件的依赖关系大,目前网上只有一个c语言的版本 用指针做的闲来无聊研究一下此排序算法,并优化写出c#版本的给大家分享现有 数组 198752 排序结果肯定是125789啦珠排序...
分类:
Web程序 时间:
2014-08-05 18:56:29
阅读次数:
354
Create an interface called Sortable in a package called sortPack. It should have one method compare which takes an Object as a parameter and returns a...
分类:
其他好文 时间:
2014-08-05 15:43:29
阅读次数:
316
#test.sh
#!/bin/bash
dir=/home/test
whilereadline
do
host=`echo$line|awk‘{print$1}‘`
passwd=`echo$line|awk‘{print$2}‘`
$dir/expect_ssh.sh$host$passwd&
done<$dir/host.txt
#expect_ssh.sh
#!/usr/bin/envexpect
setHOST[lindex$argv0]
setPASSWD[lindex$argv..
分类:
系统相关 时间:
2014-08-05 11:33:10
阅读次数:
243
/*******************************************************************************/* /* 版权所有 : -/* 模块名 : 排序/* 文件名 : sort.cpp/* 功能描述 : 排序...
分类:
编程语言 时间:
2014-08-05 11:03:39
阅读次数:
292
Absolute sortLet's try some sorting. Here is an array with the specific rules.The array (a tuple) has various numbers. You should sort it, but sort it...
分类:
其他好文 时间:
2014-08-05 10:50:49
阅读次数:
204
第一种排序:【冒泡排序】基本数据类型的排序。【1】最简易的冒泡排序。效率低。因为比较的次数和趟数最多。 1 /** 2 * 最原始的冒泡排序。 3 * 效率低。 4 * 因为趟数和次数最多。都是按最大化的循环次数进行循环 5 * @Title: sort 6 ...
分类:
编程语言 时间:
2014-08-05 09:27:48
阅读次数:
180
BAge SortInput:Standard InputOutput:Standard OutputYou are given the ages (in years) of all people of a country with at least 1 year of age. You know ...
分类:
其他好文 时间:
2014-08-05 02:57:48
阅读次数:
230