2012年6月12日

交换排序之快速排序

摘要: 快速排序(递归):#define _CRT_SECURE_NO_WARNINGS#include <iostream>using namespace std;#define LEN 8 // 有LEN个元素要排#define TESTstruct Record { // 为了考察排序的稳定性,定义元素是结构体类型 int key; int otherinfo;};int Partition(Record *arr, int low, int high){ // 交换顺序表L中子序列arr[low..high]的记录,使枢轴记录到位, // 并返回... 阅读全文

posted @ 2012-06-12 01:07 jjtx 阅读(318) 评论(0) 推荐(0) 编辑

导航