home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11807 < prev    next >
Encoding:
Internet Message Format  |  1992-07-31  |  1.0 KB

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