冒泡排序,顾名思义,按照一定的规则,把数据一直排下去直接上代码 1 import random 2 3 def bubblesort(data): 4 change=True 5 for i in range(len(data)-1,1,-1): 6 for j i...
分类:
编程语言 时间:
2014-09-03 12:54:46
阅读次数:
184
Vim实用技巧TableofContents1.Vim决问题的方式2.普通模式3.插入模式4.可视模式5.命令行模式5.1.操作文本的Ex命令5.2.range服务说明5.3.补全5.4.命令行窗口–使用vim的编辑能力编辑Ex命令5.5.执行外部命令6.管理多个文件6.1.缓冲区列表管理6.2.参数列表6.3.窗口操作6.4.标签页?.
分类:
其他好文 时间:
2014-09-03 02:40:27
阅读次数:
336
在Django视图函数中经常出现类似于‘ascii‘ codec can‘t decode byte 0xef in position 0: ordinal not in range(128)的错误。 在解决错误之前,首先要了解unicode和utf-8的区别。 unicode指的是万国码,是一种“字...
分类:
其他好文 时间:
2014-09-02 18:16:55
阅读次数:
141
for循环for i in range(): #注意冒号 range中默认从0开始 或者从指定的数字开始 到给定数字的前一个数字结束 递增递减皆是如此 for循环提供变量的自动初始化for i in range(10): print(i,end = ' ')prin...
分类:
编程语言 时间:
2014-09-02 11:45:54
阅读次数:
242
Android is an open-source software stack for a wide range of mobile devices and a corresponding open-source project led by Google. Here you can find t...
分类:
移动开发 时间:
2014-09-02 09:03:44
阅读次数:
250
for index, item in enumerate(sequence): process(index, item)列表初始化:multilist = [[0 for col in range(5)] for row in range(3)]用*初始化,出现的问题:http://www.j...
分类:
编程语言 时间:
2014-09-01 19:22:13
阅读次数:
268
function template
std::any_of
template
bool any_of (InputIterator first, InputIterator last, UnaryPredicate pred);
Test if any element in range fulfills condition
Returns true if pr...
分类:
其他好文 时间:
2014-09-01 17:42:13
阅读次数:
285
题目Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the o...
分类:
其他好文 时间:
2014-08-31 22:39:31
阅读次数:
324
def partition(A, p, r): j = p+1 for i in range(p+1, r+1): if(A[i] < A[p]): tmp = A[i] A[i] = A[j] A[j] =...
分类:
编程语言 时间:
2014-08-31 18:38:31
阅读次数:
295
tmp = []def bucket_sort(old): for i in range(len(old)): tmp.append([]) for i in old: tmp[int( i * len(old) )].append(i) ...
分类:
编程语言 时间:
2014-08-31 17:10:51
阅读次数:
490