Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!ucsd!network.ucsd.edu!weber.ucsd.edu!corrigan From: corrigan@weber.ucsd.edu (Michael J. Corrigan) Newsgroups: comp.lang.fortran Subject: Re: QuickSort w/o recursion. Message-ID: <5052@network.ucsd.edu> Date: 27 Mar 91 10:18:32 GMT References: Sender: news@network.ucsd.edu Distribution: comp Organization: Division of Social Sciences, UCSD Lines: 21 Nntp-Posting-Host: weber.ucsd.edu In article quan@sol.surv.utas.edu.au (Stephen Quan) writes: }I am in desperate seek of ideas on how to implement "QuickSort" or other }optimin sorting algorithm without the use of recursion, our Sun Fortran }(F77 version 1.2 on SunOS 4.0) compiler doesn't support recursion very }well. You don't have to *implement* such an algorithm. You can call the system-supplied C function qsort and link it in using f77 on a SUN system, I would suspect. Quite a number of the system-supplied C functions are also supplied in fortran equivalents on UNIX systems. Try "man 3f qsort" to see if the fortran library has this call. You can also do it the harder way and link the actual C call in. I wrote up a sample fortran program that sorts an 80000x2 array in around 30 seconds. I don't know if that is fast or slow, but at least you don't have to buy a book and type it in. E-mail me for the sample fortran program and C wrapper code. Michael J. Corrigan corrigan@ucsd.edu