插入排序
1 | def insert_sort(lists): |

希尔排序
1 | def shell_sort(lists): |

冒泡排序
1 | def bubble_sort(lists): |

快速排序
1 | qs = lambda xs: ((len(xs) <= 1 and [xs]) or [qs([x for x in xs[1:] if x < xs[ |

选择排序
1 | def select_sort(lists): |

堆排序
1 | def adjust_heap(lists, i, size): |

归并排序
1 | def merge(left, right): |

基数排序
1 | import math |

测试
1 | import random |
本文来自:八大排序算法的 Python 实现
