1 public class QuickSort {
5 public void quick_srt(int array[],int low, int n){
11 int mid = array[(lo + hi) / 2];
13 while (lo<hi && array[lo] < mid) {
16 while (lo<hi && array[hi] > mid) {
21 array[lo] = array[hi];
30 quick_srt(array, low, lo);
37 quick_srt(array, low, n);
40 public static void main(String[] args) {
43 QArray myArray[] = new QArray[2];
44 for(i = 0; i<2; i++) {
45 myArray[i] = new QArray();
47 QuickSort qsort = new QuickSort();
48 System.printString("Values Before sorting\n");
50 for(j = 0; j<10; j++){
51 System.printInt(myArray[i].mya[j]);
52 System.printString("\t");
54 System.printString("\n");
57 qsort.quick_srt(myArray[i].mya, 0, 9);
59 System.printString("Values After sorting\n");
61 for(j = 0; j<10; j++){
62 System.printInt(myArray[i].mya[j]);
63 System.printString("\t");
65 System.printString("\n");
67 System.printString("\n");
79 for(int i = 4; i<9; i++)