码迷,mamicode.com
首页 >  
搜索关键字:temp    ( 7776个结果
排序算法之直接插入排序算法
基本思想当插入第i(i≥1)个元素,前面的i-1个元素已经排好序。这时用第i个元素与前i-1个元素进行比较,找到插入位置即将第i个元素插入,原来位置上的元素向后顺移。 代码://待排数据存储在数组a中,以及待排序列的左右边界 public void InsertSort(int[] a, int left, int right) { int temp;//临时变量 int i, j;//循环标记...
分类:编程语言   时间:2015-07-18 09:37:34    阅读次数:144
选择排序
#ifndef SELECT_SORT_H#define SELECT_SORT_Hvoid selectSort(int *arr,int Length); void selectSort(int *arr,int Length){ int min,temp; for(int i=0;iarr[j...
分类:编程语言   时间:2015-07-17 20:59:07    阅读次数:158
快速排序
http://developer.51cto.com/art/201403/430986.htm这里唯一的注释就是为什么要先 从右边开始 即:while(arr[j]>=temp&&i=temp&&iright){ return ; } int i=left; int j=right; int te...
分类:编程语言   时间:2015-07-17 20:58:20    阅读次数:165
求出数组前面k个元素或数组中元素大于一半的元素(快速排序与堆排序的灵活运用)
写这个的目的在于,说明快速排序的灵活运用。我们来看下关于快速排序中的一部分关键代码:快速排序代码:int a[101],n;//定义全局变量,这两个变量需要在子函数中使用 void quicksort(int left,int right) { int i,j,t,temp; if(left>rig...
分类:编程语言   时间:2015-07-17 20:50:46    阅读次数:258
希尔排序
void shellSort(int *arr,int Length){ int temp; for(int gap=Length/2; gap>0;gap/=2){ for(int i=0;i=0&&arr[k]>temp){ arr[k+gap]=arr[k]; k-=gap; } arr[k+...
分类:编程语言   时间:2015-07-17 20:47:15    阅读次数:164
冒泡排序
#ifndef BUBBLING_INSERT_H[#define BUBBLING_INSERT_Hvoid bubblingInsert(int *arr,int Length); void bubblingInsert(int *arr,int Length){ int temp; for(i...
分类:编程语言   时间:2015-07-17 20:43:56    阅读次数:144
利用ROW_NUMBER中的partition by 删除重复Key的数据
With temp As( Select ROW_NUMBER() over(partition by LogisticsPlan order by createon) rowID,ID from LogisticsPlan Where LogisticsPlan IN( 'AGD...
分类:其他好文   时间:2015-07-17 11:46:56    阅读次数:116
MeteoInfoLab脚本示例:利用比湿、温度计算相对湿度
利用比湿和温度计算相对湿度的函数是qair2rh(qair, temp, press=1013.25),三个参数分别是比湿、温度和气压,气压有一个缺省值1013.25,因此计算地面相对湿度的时候也可以不给气压参数。下面的例子打开CFS模式的地面结果,并从比湿和温度数组计算出相对湿度数组并绘图。脚本程...
分类:其他好文   时间:2015-07-16 18:31:41    阅读次数:240
nginx限制访问频率
修改服务器上的nginx的配置文件/usr/local/nginx/conf/nginx.confhttp{limit_req_zone$binary_remote_addrzone=one:10mrate=3000r/m;proxy_cache_path/var/cache/nginxlevels=1:2keys_zone=one:8mmax_size=3000minactive=600m;proxy_temp_path/var/tmp;includemime.types;defau..
分类:其他好文   时间:2015-07-16 14:24:35    阅读次数:143
javascript常用方法函数收集
字符串长度截取function cutstr(str, len) { var temp, icount = 0, patrn = /[^\x00-\xff]/, strre = ""; for (var i = 0; i = 0 && this.lastIn...
分类:编程语言   时间:2015-07-16 13:34:19    阅读次数:224
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!