自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 资源 (1)
  • 收藏
  • 关注

原创 堆排序以及二叉堆的一些操作

注意: 此文中的二叉堆默认为最小二叉堆 此处的堆排序是降序排序

2015-03-15 16:47:44 471

原创 冒泡排序

# coding:utf-8 __author__ = 'taohao' """ bubble sort """ def bubble_sort(array): i = j = 0 length = len(array) while i < length-1: while j < length-i-1: if array[j] >

2015-03-15 10:59:14 365

原创 shell 排序

# coding:utf-8 __author__ = 'taohao' """ shell sort is improving the performance of the insert sort """ def shell_sort(array): gap = len(array)/2 while gap > 0: i = gap while

2015-03-14 18:35:45 496

原创 插入排序

# coding:utf-8 __author__ = 'taohao' """ insert sort """ def insert_sort(array): i = 1 while i < len(array): tem = array[i] j = i while tem 0: array[j] =

2015-03-14 18:19:35 422

原创 归并排序

# coding:utf-8 __author__ = 'taohao' """ merge sort use the extra space to exchange the time when merge two arrays, we need to use another empty array to store the completed array so the p

2015-03-14 17:12:20 445

原创 快速排序

def quick_sort(array, left, right): if left < right: # the if is necessary. only when left < right, the recursion can be handled i = left j = right tem = array[left]

2015-03-14 15:50:41 364

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除