public void qsorthelper( int begin, int end ) {
        
        if ( end - begin >= 1 ) {
            //To hold the position of the first element;
            int pivot = begin;
            int ppos = pivot;
            
            //To hold the position during the swap of data[pivot] and left or right.
            int left = begin + 1; //The reason I'm adding one is because the pivot is the first element.
            int right = end;
            
            System.out.println("Original unsorted array");
            for( int i = begin; i <= end; i++ ) {
                System.out.print(data[i] + " ");
            }
            System.out.println();
             
            boolean changed = true;
            
            while( changed ) {
                changed = false;
                for( int i = right; i > pivot; i-- ) {
                    if ( data[i] < data[pivot] ) {
                        swap( i, pivot );
                        left = pivot + 1;
                        pivot = i;
                        changed = true;
                    }
                }
                
                for( int i = left; i < pivot; i++ ) {
                    if (data[i] > data[pivot] ) {
                        swap( i, pivot );
                        right = pivot - 1;
                        pivot = i;
                        changed = true;
                    }
                }
            }    
                
            qsorthelper( begin, pivot - 1 );
            qsorthelper( pivot + 1, end );
            
        }
    }