桑海

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年12月11日

摘要: #include<iostream>#include<cstdlib>#include<ctime>using namespace std;const int maxn = 5000;int main(){ void Randomized_QuickSort(int A[], int p, int r); void out(int A[], int n); int n, A[ma... 阅读全文
posted @ 2012-12-11 19:56 桑海 阅读(918) 评论(0) 推荐(0) 编辑

摘要: 描述: 快速排序是一种排序算法,对包含n个数的输入数组,最坏情况运行时间为Θ(你……2).虽然这个最坏情况运行时间比较差,但快速排序通常是用于排序的最佳选择,,这时因为其平均性能相当好:期望的运行时间为Θ(n^2),且Θ(nlgn)记号中的常数因子很小。另外,它还能够进行就地排序,在虚拟环境中也能很好的工作。 #include<iostream>using namespace std;const... 阅读全文
posted @ 2012-12-11 13:58 桑海 阅读(219) 评论(0) 推荐(0) 编辑