// quiksort.cpp #include // to turn trace on, change 0 to 1 in #define statement // this method can also be used to debug code without having to // comment out all debugging statements later #define TRACE 0 void Swap(int &a, int &b){ int temp = a; a = b; b = temp; } void Pivot(int a[], int left, int right){ if (a[left] > a[right]){ Swap(a[left], a[right]); if (TRACE) cout << "pivot swap " << a[left] << " " << a[right] << endl; } } int Partition(int a[], int left, int right){ int pivot = a[left]; int i = left; int j = right+1; if(TRACE) cout <<"pivot = "<