Skip to content
/ sort Public

Mergesort, Quicksort and Radixsort algorithms for integer arrays

Notifications You must be signed in to change notification settings

grofz/sort

Repository files navigation

Sorting algorithms in Fortran

Just an illustration of sorting algorithms.

Usage

Compile and run the test utility

$ gfortran -Ofast quicksort.f90 mergesort.f90 radixsort.f90 driver_sort.f90 -o sort.exe
$ ./sort.exe

Program asks for the number of items to sort and prints the running time of all algorithms.

The individual sorting routines can be used separately in other applications, cf this example:

use mergesort_module
use quicksort_module
use radixsort_module
:
integer :: A(100)
:
call mergesort(A)
call quicksort(A, MODE_HOARE)   ! "mode" argument is optional
call quicksort(A, MODE_LOMUTO)
call radixsort(A)
call radixsort_msb(A)

License

MIT license applies. Provided "as is", without warranty.

About

Mergesort, Quicksort and Radixsort algorithms for integer arrays

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published