2012年2月26日

归并排序--Python

摘要: def merg_sort(lst): if(len(lst) <= 1): return lst left = merg_sort(lst[:len(lst)/2]) right = merg_sort(lst[len(lst)/2:len(lst)]) result = [] while len(left) > 0 and len(right)> 0: if( left[0] > right[0]): result.append(right.pop(0)) else: result.ap... 阅读全文

posted @ 2012-02-26 22:47 Tony.Shao 阅读(270) 评论(0) 推荐(0) 编辑

导航