Bubble sort: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Riga 115:
SUBROUTINE Bubble (X,N)
! X is the array that needs to be ordered, N is the dimension of the array.
IMPLICIT NONE
INTEGER :: N, J, I, JMAX, TEMP
INTEGER :: X(N)
JMAX=N-1
IF(X(J).GT.X(J+1)) GO TO 100
TEMP=X(J)
X(J)=X(J+1)
X(J+1)=TEMP
100 END DO
JMAX=JMAX-1
END DO
RETURN
END
|