type
status
date
slug
summary
tags
category
icon
password

1、快速排序的介绍

快速排序(Quicksort)是对冒泡排序的一种改进。基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列

2、快速排序法示意图

notion image

3、快速排序法应用实例

要求: 对 [-9,78,0,23,-567,70] 进行从小到大的排序,要求使用快速排序法
notion image

4.1、代码实现(按照中间排序)

对 [-9,78,0,23,-567,70]排序成[-9,-567,0,23,78,70]

4.1.1 输出结果

notion image

4.2、左递归排序

4.2.2 输出结果

notion image

4.2、右递归排序

4.2.2 输出结果

notion image

4.3、代码整合

 
冒泡排序 详细讲解静态类
IT小舟
IT小舟
微信公众号:IT小舟
公告
type
status
date
slug
summary
tags
category
icon
password
notion image
你好,我是小舟。 欢迎来到我的博客,我喜欢运动、阅读、音乐和写作。如果有什么想要交流的,可以加我微信:upcodezhou。再次感谢你的光临!
notion image