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

  1. Path: sparky!uunet!olivea!decwrl!mips!darwin.sura.net!wupost!gumby!destroyer!news.iastate.edu!tc4.fi.ameslab.gov!raeker
  2. From: raeker@tc4.fi.ameslab.gov (Todd J. Raeker)
  3. Newsgroups: comp.lang.c
  4. Subject: array element swapping
  5. Message-ID: <1992Jul30.161048.25439@news.iastate.edu>
  6. Date: 30 Jul 92 16:10:48 GMT
  7. Sender: news@news.iastate.edu (USENET News System)
  8. Reply-To: raeker@tc4.fi.ameslab.gov (Todd J. Raeker)
  9. Organization: Ames Laboratory
  10. Lines: 22
  11.  
  12. I need to swap values in an array while sorting it, currently I am doing
  13. the swap as follows on floats
  14.  
  15.  
  16.             temp = ztmp[j];
  17.             ztmp[j] = ztmp[k];
  18.             ztmp[k] = temp;
  19.  
  20.  
  21. This is currently a bottleneck in my program and I need to figure a 
  22. better way to do due this.  Since I am not an advanced c programmer, this
  23. is the best I could come up with, is there a more efficient way?
  24.  
  25. Thanks
  26.  
  27. -- 
  28.  
  29.  
  30. Dr. Todd J. Raeker           |      307B Wilhelm Hall
  31. raeker@tc4.fi.ameslab.gov    |      Iowa State University
  32. Phone (515)-294-9927         |      Ames Laboratory, USDOE
  33. FAX   (515)-294-5204         |      Ames, Iowa 50011
  34.