首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > #include <iostream> #include <stack> #define MAX_SIZE...

#include <iostream> #include <stack> #define MAX_SIZE...

  • 资源大小:835.00 B
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 汇编语言

资 源 简 介

非递归的快速排序算法-#include #include #define MAX_SIZE 11 using namespace std typedef int elem typedef std::stack Stack int partition(elem*pData, int low, int high) void swap(elem& a, elem& b) void qsort(elem* pData, int low, int high) int partition(elem*pData, int low, int high) { elem key = pData[low] while(low < high) { while(low < high && pData[high] >= key) high-- swap(pData[low], pData[high]) while(low < high && pData[low] <= key) low++ swap(pData[low], pData[high]) } return low } void swap(elem& a, elem& b) { if(&a != &b) { a ^= b b ^= a

文 件 列 表

5.cpp
VIP VIP
0.180873s