Python实现八大排序(基数排序、归并排序、堆排序、简单选择排序、直接插入排序、希尔排序、快速排序、冒泡排序)
八大排序
大概了解了一下八大排序,发现排序方法的难易程度相差很多,相应的,他们计算同一列表的时间也不尽相同。今天,我就准备了八种排序的python代码,并且准备测试一下他们计算的时间
基数排序
基数排序的基本思想是先将数字按照个位数上数字的大小进行排序,排序之后再将已经排过序的数字再按照十位数上数字的大小进行排序,依次推类
# 统计这个列表中数字最大的数字有几位
def radix_sort_nums(nums):
max = nums[0]
for i in nums:
if max < i:
max = i
times = 0
while max > 0:
max = int(max/10)
times += 1
return times
# 每个数字各个位置的数字大小,比如(123,1)则是3,(123,2)则是2
def get_num(num,n):
return (int(num/(10**(n-1)))) % 10
# 主程序
def radix_sort(nums):
count = 10*[None] # 定义的数组,用于存放当前位数的元素个数
bucket = len(nums)*[None] # 用于暂时存放排序结果
# 分别从个位/十位/百位开始循环
for pos in range(1, radix_sort_nums(nums)+1):
# 每次排序完都要清空各个位数存放的数据统计
for i in range(10):
count[i] = 0
for i in range(len(nums)):
# 获得0到9每个位数的个数
j = get_num(nums[i], pos)
count[j] = count[j]+1
# 获得相对应位数的边界值
for i in range(1, 10):
count[i] = count[i] + count[i-1]
for i in range(len(nums)-1, -1, -1):
# 求出相应位数的数字
j = get_num(nums[i], pos)
将元素按相应位数的上数字的大小排序
bucket[count[j]-1] = nums[i]
让相应位数上数字相等的元素不会放在同一位置而被替代
count[j] = count[j]-1
# 将暂时存储在bucket的元素数据返回到nums中
for i in range(0, len(nums)):
nums[i] = bucket[i]
return nums
print(radix_sort([45, 32, 8, 33, 12, 22, 19, 97]))
归并排序
归并排序其实是将原数列分为很多个小数列将其排序,在小数列排序完之后,再将各个小数列进行排序,最后得到一个全部有序的数列
# 归并排序
# 这个函数主要目的是为了实现合并并排序
def mergearray(nums, first, mid, last, temp):
# i, j分别是第一个组数的第一个位置,第二组数的第一个位置
i, j, k = first, mid+1, 0
# 当俩边数组都存在数的时候,依次比较对应位置的大小
while i <= mid and j <= last:
if nums[i] <= nums[j]:
temp[k] = nums[i]
i = i+1
k = k+1
else:
temp[k] = nums[j]
j = j+1
k = k+1
# 第一组数还有多的数的情况
while i <= mid:
temp[k] = nums[i]
i = i+1
k = k+1
# 第二组数还有多的情况
while (j <= last):
temp[k] = nums[j]
j = j+1
k = k+1
# 将排列过的数组赋予nums(开始的时候只是部分有序,随着递归最后变成全部有序)
for i in range(k):
nums[first+i] = temp[i]
# 分组,利用递归
def merge_sort(nums,first,last,temp):
if first < last:
mid = int((first + last) / 2)
# 分出第一组数
merge_sort(nums, first, mid, temp)
# 分出第二组数
merge_sort(nums, mid+1, last, temp)
# 合并并排序
mergearray(nums, first, mid, last, temp)
def merge_sort_array(nums):
# 创建一个和想要排序数列相同数量的空列表
temp = len(nums)*[None]
# 利用递归进行排序
merge_sort(nums, 0, len(nums)-1, temp)
print(merge_sort_array([45, 32, 8, 33, 12, 22, 19, 97]))
堆排序
堆排序利用了二叉树的结构,使子节点的值一直小于根节点
def big_endian(arr, start, end):
root = start
child = root * 2 + 1 # 左孩子
while child <= end:
# 孩子比最后一个节点还大,也就意味着最后一个叶子节点了,就得跳出去一次循环,已经调整完毕
if child + 1 <= end and arr[child] < arr[child + 1]:
# 为了始终让其跟子元素的较大值比较,如果右边大就左换右,左边大的话就默认
child += 1
if arr[root] < arr[child]:
# 父节点小于子节点直接交换位置,同时坐标也得换,这样下次循环可以准确判断:是否为最底层,
# 是不是调整完毕
arr[root], arr[child] = arr[child], arr[root]
root = child
child = root * 2 + 1
else:
break
def heap_sort(nums): # 无序区大根堆排序
first = len(nums) // 2 - 1
for start in range(first, -1, -1):
# 从下到上,从左到右对每个节点进行调整,循环得到非叶子节点
big_endian(nums, start, len(nums) - 1) # 去调整所有的节点
for end in range(len(nums) - 1, 0, -1):
nums[0], nums[end] = nums[end], nums[0] # 顶部尾部互换位置
big_endian(nums, 0, end - 1) # 重新调整子节点的顺序,从顶开始调整
return nums
print(heap_sort([3, 1, 4, 9, 6, 7, 5, 8, 2, 10]))
简单选择排序
简单选择排序的方法则是将所选值与剩下值中比他小的值进行比较
比如选取第一个值,往后找到比他小的值就与其对调,对调后的值再接下去进行比较,直至找到最小的值,随后再第二个值……直至循环到倒数第二个值
def select_sort(nums):
# 遍历所有的值
for i in range(len(nums)):
# 当前位置初始值
min = nums[i]
# 与比他后面的值进行比较,小则互换
for j in range(i+1, len(nums)):
if nums[j] < min:
nums[j], min = min, nums[j]
# 将值返回数列
nums[i] = min
return nums
print(select_sort([45, 32, 8, 33, 12, 22, 19, 97]))
直接插入排序
首先遍历所有元素,随后从第一个数开始将数列从后往前遍历,如果后面的数小于前面的数,则互换位置,依次推类,直到遍历完成
# 直接插入排序
def insert_sort(nums):
for i in range(len(nums)-1):
for j in range(i, -1, -1):
if nums[j] > nums[j+1]:
nums[j], nums[j + 1] = nums[j + 1], nums[j]
return nums
print(insert_sort([45, 32, 8, 33, 12, 22, 19, 97]))
希尔排序
希尔排序其实就相当于对直接插入排序的升级版,每次都选取一半的长度,随后利用直接插入法进行排序,从而更快的获得结果
aaarticlea/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAmwAAAHxCAIAAABf53dyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAEenSURBVHja7N1/bCPnfe/7Z9ptYVPFiZ2Uu+66yMrAUHVpObb3WC0wvDe6NWCfDIXkEPlDSHqvo6AthgcBkuG2UOEeCAauISDG0R/LaYCiJNLcKkbRYP8oiAaaSbK4PlAOyNtGhu3UCo+jGcCSe7zdXTbezalFG65P5/7BmeHwh7SrXfEZSnq/sH9IpFYcPRzO5/k+88wziu/7AgAAHNwv0AQAABCiAAAQogAAEKIAABCiAACAEAUAgBAFAIAQBQCAEAUAgBAFAACEKAAAhCgAACc3RD3H8Q75N3oe7yAA4CSEqJrZWlCUonMHYWnllCH/01nJZJScRZACAI59iArVXC1r1eWDp57bbGhlt6L3Z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fe29AgmvWREuxy1uA3tvJZYZeQiBrLf7EN2D/zZA7RtL9YEpb+L6nX7uxxwLO0t6LgeXvJb0LVKLAQenZ+Nqk3fD2x2bVNznUc/XBdjCyvi8rwBLfgL03w7AlLyAcLZyUyHXDKbMemxqdzHsRLfIXz28J7wKVKAAAVKIAABCiAAAcCSy2AOBOrCvKLX9mlrNFoBIFAABDMbEIAAAqUQAACFEAAAhRAAAIUQAAQIgCAECIAgBAiAIAQIgCAHCi/P8DAB2fYcvfnsFJAAAAAElFTkSuQmCC" alt="img">
def insert_shell(nums):
# 初始化l值,此处利用序列长度的一半为其赋值
l = int(len(nums)/2)
# 第一层循环:依次改变l值对列表进行分组
while l >= 1:
# 下面:利用直接插入排序的思想对分组数据进行排序
for i in range(len(nums) - 1):
for j in range(i, -1, -1):
if nums[j] > nums[j + 1]:
nums[j], nums[j + 1] = nums[j + 1], nums[j]
# while循环条件折半
l = int(l/2)
return nums
快速排序
快速排序首先得选取一个基准值,这个代码用第一个数作为基准值,将比基准值小的值放到左边,比基准值大的值放到右边,随后再将左边后右边按照上述方法进行排序,直到完全正确为止
# 实现快速排序方法的函数
def quick_sort_num(nums,start,end):
if start < end:
# 定义基准值为第一个数
i, j, pivot = start, end, nums[start]
while i < j:
# 将基准数右边的数中比基准数小的放到左边
while i < j and nums[j] >= pivot:
j = j-1
if i < j:
nums[i] = nums[j]
i = i+1
# 将基准数左边的数中比基准数大的数放到右边
while i < j and nums[i] < pivot:
i = i+1
if i < j:
nums[j] = nums[i]
j = j-1
nums[i] = pivot
# 分别将基准数左边的数列和右边的数列进行递归
quick_sort_num(nums, start, i-1)
quick_sort_num(nums, i+1, end)
return nums
# 快速排序主体函数
def quick_sort(nums):
start = 0
end = len(nums)-1
nums = quick_sort_num(nums, start, end)
return nums
print(quick_sort([45, 32, 8, 33, 12, 22, 19, 97]))
冒泡排序
冒泡排序是最简单的排序,依次将左右俩个元素进行比较,每次比较完最后的一个数必定是最大的,依次推类,直到全部元素都比较玩
def bubble_sort(nums):
# 交换的轮数
for i in range(len(nums) - 1):
# 每一轮交换
for j in range(len(nums) - i - 1):
# 比较值,并根据大小进行互换
if nums[j] > nums[j + 1]:
nums[j], nums[j + 1] = nums[j + 1], nums[j]
return nums
print(bubble_sort([45, 32, 8, 33, 12, 22, 19, 97]))
时间测试
我们先创建一个列表,列表中有10000条数据,随后用相同的数据进行测试
import random
lis = []
for i in range(10000):
i = random.randint(0,500)
lis.append(i)
print(lis)
创出来的数据就不进行展示了。。
随后我们进行测试:
冒泡排序法:11.535502672195435
直接插入排序法:12.057243585586548
希尔排序法:86.3020749092102(大概是我的方法不大好吧,我差点以为他排不出来了)
基数排序法:0.051932334899902344(老大哥就是牛皮)
归并排序法:0.08577108383178711(233)
快速排序:0.04795527458190918
堆排序:0.09175491333007812
根据自己的测试,基数排序,归并排序,快速排序,和堆排序速度很快,感觉随着代码量的增长时间增长很慢,其余的几个则不尽如人意了
Python实现八大排序(基数排序、归并排序、堆排序、简单选择排序、直接插入排序、希尔排序、快速排序、冒泡排序)的更多相关文章
- 插入排序:直接插入排序&希尔排序
一.直接插入排序 1. 思想 直接排序法, 可以分为两个部分, 一部分是有序的, 一部分是无序的. 从这个图上, 应该是能看清楚直接插入排序的思想了. 将无序部分的第一个与有序部分进行比较. 从有序部 ...
- 学习C#之旅 冒泡排序,选择排序,插入排序,希尔排序[资料收集]
关于冒泡排序,选择排序,插入排序,希尔排序[资料收集] 以下资料来源与网络 冒泡排序:从后到前(或者从前到后)相邻的两个两两进行比较,不满足要求就位置进行交换,一轮下来选择出一个最小(或最大)的放到 ...
- 9, java数据结构和算法: 直接插入排序, 希尔排序, 简单选择排序, 堆排序, 冒泡排序,快速排序, 归并排序, 基数排序的分析和代码实现
内部排序: 就是使用内存空间来排序 外部排序: 就是数据量很大,需要借助外部存储(文件)来排序. 直接上代码: package com.lvcai; public class Sort { publi ...
- c# 自定义排序类(冒泡、选择、插入、希尔、快速、归并、堆排序等)
using System; using System.Text; namespace HuaTong.General.Utility { /// <summary> /// 自定义排序类 ...
- Java排序算法(二):简单选择排序
[基本思想] 在要排序的一组数中.选出最小的一个数与第一个位置的数交换:然后在剩下的数中再找出最小的与第二个位置的数交换,如此循环至倒数第二个数和最后一个数比較为止. 算法关键:找到最小的那个数.并用 ...
- 冒泡排序 & 选择排序 & 插入排序 & 希尔排序 JavaScript 实现
之前用 JavaScript 写过 快速排序 和 归并排序,本文聊聊四个基础排序算法.(本文默认排序结果都是从小到大) 冒泡排序 冒泡排序每次循环结束会将最大的元素 "冒泡" 到最 ...
- 直接插入排序&希尔排序
1.直接插入排序 时间复杂度O(n2) 工作原理: 通过构建有序序列,对于未排序数据,在已排序的序列中,从后向前扫描,找到相应的位置并插入. 插入排序在实现上,在从后向前扫描的过程中,需要反复把已排序 ...
- 插入排序—希尔排序(Shell`s Sort)原理以及Java实现
希尔排序是1959 年由D.L.Shell 提出来的,相对直接排序有较大的改进.希尔排序又叫缩小增量排序 基本思想: 先将整个待排序的记录序列分割成为若干子序列分别进行直接插入排序,待整个序列中的记录 ...
- 冒泡,简单选择,直接插入排序(Java版)
冒泡.简单选择,直接插入这三种排序都是简单排序. 工具类 package Utils; import java.util.Arrays; public class SortUtils { public ...
- 数组排序-冒泡排序-选择排序-插入排序-希尔排序-快速排序-Java实现
这五种排序算法难度依次增加. 冒泡排序: 第一次将数组相邻两个元素依次比较,然后将大的元素往后移,像冒泡一样,最终最大的元素被移到数组的最末尾. 第二次将数组的前n-1个元素取出,然后相邻两个元素依次 ...
随机推荐
- Python动态展示遗传算法求解TSP旅行商问题(转载)
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/jiang425776024/articl ...
- 牛顿法与拟牛顿法(三) DFP算法
转自 https://blog.csdn.net/itplus/article/details/21896981
- flutter中的异步机制 Future
饿补一下Flutter中Http请求的异步操作. Dart是一个单线程语言,可以理解成物理线路中的串联,当其遇到有延迟的运算(比如IO操作.延时执行)时,线程中按顺序执行的运算就会阻塞,用户就会感觉到 ...
- shell cat 用法
cat命令的用途是连接文件或标准输入并打印. 1.命令格式:cat [选项] [文件]... 2.命令功能:cat主要有三大功能:1.一次显示整个文件:cat filename --常用来显示文件 ...
- jQuery源码解读----part 1
来源:慕课网 https://www.imooc.com/video/4392 jQuery整体架构 jQuery按我的理解分为五大块,选择器.DOM操作.事件.AJAX与动画, 那么为什么有13个模 ...
- Mac下安装MySQL 5.6.40
Mac下安装MySQL 5.6.40 - 干勾鱼的CSDN博客 - CSDN博客 原创 Mac下安装MySQL 5.6.40 2018-06-18 10:34:03 我是干勾鱼 阅读数 5927 ...
- RecyclerView下拉刷新和上拉加载更多实现
RecyclerView下拉刷新和上拉加载更多实现 转 https://www.jianshu.com/p/4ea7c2d95ecf 在Android开发中,RecyclerView算是使用频率非 ...
- 如何用CSS3来实现卡片的翻转特效
CSS3实现翻转(Flip)效果 动画效果 效果分析 当鼠标滑过包含块时,元素整体翻转180度,以实现“正”“反”面的切换. HTML分析 分析:.container,.flip为了实现动画效果做准备 ...
- vue 高德地图
index.html <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119. ...
- 电力项目十一--js添加浮动框
1.添加浮动窗口样式 <!-- 浮动窗口样式css begin --> <style type="text/css"> #msg_win{border:1p ...