/* Unoptimized quicksort implementation Written 4 Mar 2004 by Warren M Myers templatized swap not ideal for int or char types for int and char types, use : x^=y; y^=x; x^=y; */ #ifndef _QSORTU_H_ #define _QSORTU_H_ template void swap(T &l, T &r){ T t = l; l = r; r = t; } template int part(T a[], int l, int r){ T p = a[l]; int i = l, j = r+1; do{ while(a[++i]p); swap(a[i],a[j]); }while(i void qsort(T a[], int l, int r){ if(l