Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!cmh117 From: CMH117@PSUVM.BITNET (Charles Hannum) Newsgroups: comp.lang.c Subject: Re: sorting strings Message-ID: <89321.162458CMH117@PSUVM.BITNET> Date: 17 Nov 89 21:24:57 GMT References: <4496@blake.acs.washington.edu> <1637@crdos1.crd.ge.COM> Distribution: usa Organization: Penn State University Lines: 24 In article <1637@crdos1.crd.ge.COM>, davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) says: > >In article <4496@blake.acs.washington.edu> jimmy@blake.acs.washington.edu (Jim >Li) writes: > >| What sorting algorithm shoud I use? Should I use the built-in 'qsort()'? >| How about mergesort and heapsort? >| (I want my program to run as FAST as possible!) > > One technique commonly used for sorting strings is to create a vector >of pointers to the individual strings and then sort the pointers. You >can then write or move the data is you must. This is commonly known as an "indexed sort," and speeds up sorting by only moving pointers around, rather than the actual blocks of data. However, this does not answer his question about the actual sorting algorithm. I I will leave *that* for someone else to answer. -- - Charles Martin Hannum II "Klein bottle for sale ... inquire within." (and PROUD OF IT!!!) "To life immortal!" c9h@psuecl.psu.edu "No noozzzz izzz netzzzsnoozzzzz..." cmh117@psuvm.psu.edu "Mem'ry, all alone in the moonlight ..."