voidQsort(int beg, int end){ int mid = str[(beg + end) / 2]; int i = beg, j = end; do { while (str[i] < mid)i++; while (str[j] > mid)j--; if (i <= j) { swap(str[i], str[j]); i++; j--; } } while (i <= j); if(beg<j)Qsort(beg,j); if(i<end)Qsort(i, end); }