算法Sedgewick第四版-第1章基础-2.3 Quicksort-001快速排序
一、
1.特点
(1)The quicksort algorithm’s desirable features are that it is in-place (uses only a small auxiliary stack) and that
it requires time proportional to N log N on the average to sort an array of length N.
(2)quicksort has a shorter inner loop than most other sorting algorithms, which means that it is fast in practice as well as in theory.
2.缺点:
(1)Its primary drawback is that it is fragile in the sense that some care is involved in the implementation to be sure to avoid bad performance.
(2)
二、
算法Sedgewick第四版-第1章基础-2.3 Quicksort-001快速排序的更多相关文章
- 算法Sedgewick第四版-第1章基础-001递归
		
一. 方法可以调用自己(如果你对递归概念感到奇怪,请完成练习 1.1.16 到练习 1.1.22).例如,下面给出了 BinarySearch 的 rank() 方法的另一种实现.我们会经常使用递归, ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-001选择排序法(Selection sort)
		
一.介绍 1.算法的时间和空间间复杂度 2.特点 Running time is insensitive to input. The process of finding the smallest i ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-007归并排序(自下而上)
		
一. 1. 2. 3. 二.代码 package algorithms.mergesort22; import algorithms.util.StdIn; import algorithms.uti ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-006归并排序(Mergesort)
		
一. 1.特点 (1)merge-sort : to sort an array, divide it into two halves, sort the two halves (recursivel ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-005插入排序的改进版
		
package algorithms.elementary21; import algorithms.util.StdIn; import algorithms.util.StdOut; /***** ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-004希尔排序法(Shell Sort)
		
一.介绍 1.希尔排序的思路:希尔排序是插入排序的改进.当输入的数据,顺序是很乱时,插入排序会产生大量的交换元素的操作,比如array[n]的最小的元素在最后,则要经过n-1次交换才能排到第一位,因为 ...
 - 算法Sedgewick第四版-第1章基础-2.1Elementary Sortss-002插入排序法(Insertion sort)
		
一.介绍 1.时间和空间复杂度 运行过程 2.特点: (1)对于已排序或接近排好的数据,速度很快 (2)对于部分排好序的输入,速度快 二.代码 package algorithms.elementar ...
 - 算法Sedgewick第四版-第1章基础-1.3Bags, Queues, and Stacks-001可变在小的
		
1. package algorithms.stacks13; /******************************************************************* ...
 - 算法Sedgewick第四版-第1章基础-1.4 Analysis of Algorithms-005计测试算法
		
1. package algorithms.analysis14; import algorithms.util.StdOut; import algorithms.util.StdRandom; / ...
 - 算法Sedgewick第四版-第1章基础-1.4 Analysis of Algorithms-002如何改进算法
		
1. package algorithms.analysis14; import algorithms.util.In; import algorithms.util.StdOut; /******* ...
 
随机推荐
- 【Oracle】异常信息的加工处理
			
引言 很多时候,我们调用oracle存储过程都会发生各种各样的异常信息,例如ORA-12899值过大,ORA-01400不能插入空值等.虽然说这类异常是前端没控制到位的缘故,但是现实很难100 ...
 - C++中string的常见用法
			
在ACM中主要用到string的这几个功能:赋值,添加,删除,替换,查找,比较,反向排序. 1.赋值 直接来就行: string ss; ss="aaa"; 或者 string s ...
 - Android Volley完全解析(二),使用Volley加载网络图片
			
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/17482165 在上一篇文章中,我们了解了Volley到底是什么,以及它的基本用法. ...
 - CodeForces - 961D:Pair Of Lines (几何,问两条直线是否可以覆盖所有点)
			
You are given n points on Cartesian plane. Every point is a lattice point (i. e. both of its coordin ...
 - JSplitPane的简单实现
			
import java.awt.Color; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.J ...
 - nodejs 不同请求获取前端传的参数
			
get方法 参数在req.query中获取 router.get('/', function(req, res, next) { console.log("reqquery:",r ...
 - Maven:Resource	Path	Location	Type Project configuration is not up-to-date with pom.xml. Run project configuration update
			
Maven构建项目的时候提示: Description Resource Path Location Type Project configuration is not up-to-date with ...
 - 推荐几本学习MySQL的好书
			
转载:http://mingxinglai.com/cn/2015/12/material-of-mysql/ 我这里推荐几本MySQL的好书,应该能够有效避免学习MySQL的弯路,并且达到一个不错的 ...
 - Sentry深入
			
Sentry的架构 内部架构 核心就是规则引擎以及Metadata Store:记录格式有两种,一种policy file记录授权内容,另外一种是通过命令方式进行授权:前者记录在策略文件中,保存形式是 ...
 - LOJ 10189 仓库建设 ——斜率优化dp
			
题目:https://loj.ac/problem/10189 #include<iostream> #include<cstdio> #include<cstring& ...