快速排序
#include
#include
#include
using namespace std;
/*
* 交換兩個數
*/
void exchange(unsigned int *p,unsigned int *q)
{
unsigned int temp;
temp=*p;
*p=*q;
*q=temp;
}
/*
* 快速排序
*
*/
unsigned int partition_sort(unsigned int array[],unsigned int start,unsigned int end);
unsigned int partition_sort_another(unsigned int array[],unsigned int start,unsigned int end);
unsigned int randomized_partition_sort(unsigned int array[],unsigned int start,unsigned int end);
void quicksort(unsigned int array[],unsigned int start,unsigned int end)
{
unsigned int cut;
if(start