1. 逐个比较字符的ASSCII码值strcmpstrcasecmp 不区分大小写“==”也是这个比较方式,只是不能返回数字,只能判断大小。2. 字母部分按ASSCII码值比较,数字部分按自然排序(数字会尽可能地取到最大)strnatcmpstrnatcasecmp3. 逐个比较前n个字符的ASSC...
分类:
其他好文 时间:
2014-07-03 21:03:54
阅读次数:
239
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:
其他好文 时间:
2014-07-03 20:58:08
阅读次数:
248
希尔排序通过比较相距一定间隔的元素来工作,各趟比较所用的距离随着算法的进行而减小,直到只比较相邻元素的最后一趟排序为止。所以希尔排序也叫缩小增量排序。希尔排序使用一个序列h1,h2,....,hn,叫做增量序列,只要h1=1,任何增量序列都是可以的,不过有些增量序列比另外一些增量序列更好。在使用增量...
分类:
其他好文 时间:
2014-07-03 20:37:33
阅读次数:
175
冒泡排序--递归实现 1 void SortByRecursion( int *array, int n ) 2 { 3 int i; 4 if(1 == n) 5 { 6 return; 7 } 8 for(i = 0; i array[i...
分类:
其他好文 时间:
2014-07-03 20:07:37
阅读次数:
157
python中os模块中文帮助python中os模块中文帮助文档文章分类:Python编程python中os模块中文帮助文档翻译者:butalnd 翻译于2010.1.7——2010.1.8,个人博客:http://butlandblog.appspot.com/注此模块中关于unix中的函数大部分...
分类:
编程语言 时间:
2014-07-03 20:03:08
阅读次数:
333
row_number() OVER (PARTITION BY COL1 ORDER BY COL2)
--表示根据COL1分组,在分组内部根据 COL2排序,而此函数返回的值就表示每组内部排序后的顺序编号(组内连续的唯一的)
例子一: create table student (id int ,classes int ,score int);
insert into student val...
分类:
其他好文 时间:
2014-07-03 18:33:50
阅读次数:
213
选择排序
定义:依次选择最小的元素放在相应的位置上
特点:比较次数是 N(N-1)/2 交换次数是 N (each exchange puts an item into its ?nal position, so the number of exchanges is N. Thus, the running time is dominated by the number of
com...
分类:
其他好文 时间:
2014-07-03 15:44:01
阅读次数:
259
1.yum install lrzsz wget git2.安装gitosis:gitosis为Git用户权限管理系统,通过管理服务端的/home/git/.ssh/authorized_key文件来执行对用户权限的管理,是一个python模块包#yum install python python-...
分类:
其他好文 时间:
2014-07-03 12:41:36
阅读次数:
324
#-*-coding:utf-8-*-#====================#File:python#Author:python#Date:2014#====================__author__='Administrator'#第6章unicode#unicode支持超过9000...
分类:
编程语言 时间:
2014-07-03 12:23:00
阅读次数:
378
题目:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ...
分类:
其他好文 时间:
2014-07-03 12:10:12
阅读次数:
191