"Chapter-3 分治策略1:快速排序简介及实现"
需积分: 0 87 浏览量
更新于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 上传
图像车间
- 粉丝: 38
- 资源: 296
最新资源
- Angular实现MarcHayek简历展示应用教程
- Crossbow Spot最新更新 - 获取Chrome扩展新闻
- 量子管道网络优化与Python实现
- Debian系统中APT缓存维护工具的使用方法与实践
- Python模块AccessControl的Windows64位安装文件介绍
- 掌握最新*** Fisher资讯,使用Google Chrome扩展
- Ember应用程序开发流程与环境配置指南
- EZPCOpenSDK_v5.1.2_build***版本更新详情
- Postcode-Finder:利用JavaScript和Google Geocode API实现
- AWS商业交易监控器:航线行为分析与营销策略制定
- AccessControl-4.0b6压缩包详细使用教程
- Python编程实践与技巧汇总
- 使用Sikuli和Python打造颜色求解器项目
- .Net基础视频教程:掌握GDI绘图技术
- 深入理解数据结构与JavaScript实践项目
- 双子座在线裁判系统:提高编程竞赛效率