quicksortI4 Subroutine

public recursive subroutine quicksortI4(array, left, right)

Arguments

Type IntentOptional Attributes Name
integer, pointer :: array(:)
integer, intent(in) :: left
integer, intent(in) :: right

Source Code

    recursive subroutine quicksortI4(array, left, right)

        integer, pointer :: array(:)
        integer, intent(in)    :: left, right

        integer :: pindex, npindex
        if(right .gt. left) then
            pindex = left + (right - left)/2
            npindex = partition(array, left, right, pindex)
            call quicksortI4(array, left, npindex-1)
            call quicksortI4(array, npindex+1, right)
        endif
    end subroutine quicksortI4