home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Newsgroups: comp.lang.c
- Subject: Re: array element swap help
- Message-ID: <1992Jul31.113829.18142@klaava.Helsinki.FI>
- Date: 31 Jul 92 11:38:29 GMT
- References: <1992Jul30.185540.10776@CSD-NewsHost.Stanford.EDU> <1992Jul30.203049.2800@klaava.Helsinki.FI> <1992Jul30.220758.14925@CSD-NewsHost.Stanford.EDU>
- Organization: University of Helsinki
- Lines: 17
-
- amorgan@Xenon.Stanford.EDU (Crunchy Frog) writes:
- >>The best way to speed it up is to eliminate it altogether.
- >
- >Huh? Maybe the constant drug use is getting to me, but I don't see how
- >you can do that. Sure, you can reduce it by using a better sort
- >(as you say below), but to sort things you have to change their position.
-
- Uh, no. You only need to define the collating order in some suitable
- way, and have _any_ array sorted, regardless of their contents. See, no
- swapping.
-
- Sorry, couldn't resist.
-
- I was being unclear, what I meant was to reduce the number of swaps.
-
- --
- Lars.Wirzenius@helsinki.fi
-