quick_sort_integer Subroutine

public recursive subroutine quick_sort_integer(arr, low, high)

Arguments

Type IntentOptional Attributes Name
integer(kind=ik), intent(inout) :: arr(:)
integer, intent(in) :: low
integer, intent(in) :: high

Source Code

    recursive subroutine quick_sort_integer(arr, low, high)
        integer(ik), intent(inout) :: arr(:)
        integer, intent(in) :: low, high
        integer :: pivot_index

        if (low < high) then
            pivot_index = partition_integer(arr, low, high)
            call quick_sort_integer(arr, low, pivot_index - 1)
            call quick_sort_integer(arr, pivot_index + 1, high)
        end if
    end subroutine quick_sort_integer