12 integer,
intent(in) :: nA
13 real(kind=kind(1.0D0)),
dimension(nA),
intent(inout) :: A
16 integer :: left, right, mid
17 real(kind=kind(1.0D0)) :: pivot, temp
31 if (a(mid) >= a(1))
then
32 if (a(mid) <= a(na))
then
34 else if (a(na) > a(1))
then
39 else if (a(1) <= a(na))
then
41 else if (a(na) > a(mid))
then
50 do while (left < right)
52 do while (a(right) > pivot)
56 do while (a(left) < pivot)
59 if (left < right)
then
66 if (left == right)
then
89 integer,
intent(in) :: nA
90 real(kind=kind(1.0D0)),
dimension(nA),
intent(in out) :: A
93 real(kind=kind(1.0D0)) :: temp
101 if (a(j) <= temp)
exit
subroutine insertionsort_d(A, nA)
subroutine to sort using the insertionsort algorithm
recursive subroutine quicksort_d(a, na)
subroutine to sort using the quicksort algorithm