in this program i want from the user choose if he want the pivot in the first or last !
//
// main.cpp
// pivot
//
// Created on 12/18/13.
// Copyright (c) 2013. All rights reserved.
//
#include <iostream>
using namespace std;
int pivot(int *S[],int first,int last);
void Qiucksort(int *S,int first,int last);
int main()
{
int size,first=0,last;
cout<<"Enter the size: ";
cin>>size;
last=size-1;
int *S=new int [size];
cout<<"Enter the Array : "<<endl;
for(int i=0;i<size;i++)
cin>>S[i];
first=first+1;
}
}
return first;
}
void Qiucksort (int *S ,int first , int last)
{
int m;
if(first<last)
{
m=pivot(S,first,last);
Qiucksort (S , first ,m-1);
Qiucksort ( S ,m+1,last);