"Chapter-3 分治策略1:快速排序简介及实现"
需积分: 0 60 浏览量
更新于2024-01-16
收藏 816KB PDF 举报
Section 3 of the chapter introduces the divide and conquer strategy, which involves dividing an array into two sub-arrays, sorting the sub-arrays, and then merging them back together. The example used to illustrate this strategy is the quicksort algorithm, known for its popularity and efficiency with an average time complexity of Θ(nlogn). Quicksort is preferred over merge sort as it sorts the array in place without requiring additional storage space, in contrast to merge sort which requires Θ(n) additional space. The algorithm was developed by Charles A. R. Hoare in 1960 and has since become one of the most widely used algorithms worldwide. Hoare's contributions to the field of computer science and education were recognized with the Turing Award in 1980 and a knighthood from the British monarchy in 2000.
In the context of quicksort, an example is provided to demonstrate the sorting of the array A[1...8]={4, 6, 3, 1, 8, 7, 2, 5} in non-decreasing order. The algorithm begins by splitting the array based on a pivot element - the first element in this case. The array is divided into two sub-arrays such that elements to the left of the pivot are less than or equal to the pivot, and elements to the right are greater than or equal to the pivot. The same operation is then applied to the left and right sub-arrays.
Overall, the chapter emphasizes the effectiveness and practicality of the divide and conquer strategy, especially in the context of the quicksort algorithm. It highlights the significant contributions of Charles A. R. Hoare to the field of computer science and the widespread use of the quicksort algorithm. Additionally, it provides a clear example of the application of the divide and conquer strategy in sorting an array using the quicksort algorithm.
2022-08-03 上传
2009-04-19 上传
2022-09-14 上传
2022-09-24 上传
2021-04-05 上传
2022-06-20 上传
2022-06-20 上传
2022-09-23 上传
2020-09-15 上传
图像车间
- 粉丝: 37
- 资源: 296
最新资源
- IEEE 14总线系统Simulink模型开发指南与案例研究
- STLinkV2.J16.S4固件更新与应用指南
- Java并发处理的实用示例分析
- Linux下简化部署与日志查看的Shell脚本工具
- Maven增量编译技术详解及应用示例
- MyEclipse 2021.5.24a最新版本发布
- Indore探索前端代码库使用指南与开发环境搭建
- 电子技术基础数字部分PPT课件第六版康华光
- MySQL 8.0.25版本可视化安装包详细介绍
- 易语言实现主流搜索引擎快速集成
- 使用asyncio-sse包装器实现服务器事件推送简易指南
- Java高级开发工程师面试要点总结
- R语言项目ClearningData-Proj1的数据处理
- VFP成本费用计算系统源码及论文全面解析
- Qt5与C++打造书籍管理系统教程
- React 应用入门:开发、测试及生产部署教程