next up previous
Next: About this document ...

ESC 251 HW 28 Due: Nov. 13

1)
(10 pts) One operation that is often needed in computing is sorting an array (either in increasing order, decreasing order or by some other criteria).



Write a program that will read the integer values from the data file hw28_1.in into an array variable. Your program should then use the attached subroutine to sort the values in the array in increasing order. You should print out the array before and after sorting to verify that it is working.



The calling sequence for the subroutine is

    CALL qsort(array,1,length)
where array is the array to be sorted and length is the number of elements in the array.



To compile the program, use the syntax

    gfortran -fbounds-check yourmain.f90 qsort.f90





2017-11-10