static void quickSort(int arrays[], int begin, int end) throws Exception {
        int low = begin;
        int high = end;

        if (begin >= end) {
            return;
        }

        int mid = arrays[(begin + end) / 2];

        while (low <= high) {
            while ((low < end) && (arrays[low] < mid)){
                ++low;
            }

            while ((high > begin) && (arrays[high] > mid)){
                --high;
            }

            if (low <= high) {
                swap(arrays, low, high);
                ++low;
                --high;
            }
        }

        if (begin < high)
            quickSort(arrays, begin, high);

        if (low < end)
            quickSort(arrays, low, end);

    }