Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!ucbvax!agate!apple!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Quick Sort in C Message-ID: <10550@smoke.BRL.MIL> Date: 19 Jul 89 06:01:34 GMT References: <2762@zeus.unl.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <2762@zeus.unl.edu> STEIMLE@zeus.unl.edu (Scott A.) writes: >I'm not at all acquainted with C, but need a short section of code to >perform a quick sort. Does anyone out there have this? It should already exist in your C library, under the name qsort(). All you have to do is set up the array to be sorted (which might consist of pointers to other objects), provide a function that knows how to compare the order of two records in the array, and invoke the library function to perform the quicksort algorithm.