home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / theory / 1800 < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.5 KB  |  54 lines

  1. Newsgroups: comp.theory
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!judy.uh.edu!cscc13
  3. From: cscc13@judy.uh.edu (NAVEED IQBAL)
  4. Subject: Re: Generic sorting functions
  5. Message-ID: <21AUG199223521492@judy.uh.edu>
  6. News-Software: VAX/VMS VNEWS 1.41    
  7. Sender: usenet@menudo.uh.edu (USENET News System)
  8. Nntp-Posting-Host: judy.uh.edu
  9. Organization: University of Houston
  10. References: <9208212151.AA44579@cs90code.csv-tgsc.amex-trs.com>
  11. Date: Sat, 22 Aug 1992 04:52:00 GMT
  12. Lines: 40
  13.  
  14. In article <9208212151.AA44579@cs90code.csv-tgsc.amex-trs.com>, gonzalod@amex-trs.com (Gonzalo Diethelm) writes...
  15. >Distribution: world
  16. >Hello everyone,
  17. >A very generic question. Given a set S of n strings (the `|' characters
  18. >are used as delimiters):
  19. >  s1   |dunno|
  20. >  s2   |I'd rather have a bottle in front of me than a frontal lobotomy|
  21. >  s3   |eschew clever rules|
  22. >  ... ...
  23. >  sn   |bzzzzt!|
  24. >and an ordering sequence O:
  25. >  {s4, s1, s6, s2, sn, s3, ... s7}
  26. >is there any way to determine a fixed, hopefully cheap function
  27. >  f(): SxS -> integers
  28. >with the property that
  29. >  if si comes before sj in O, f(si, sj) < 0
  30. >  if si comes after  sj in O, f(si, sj) > 0
  31. >that is, could be used to sort the strings in the given sequence?
  32.  
  33.  
  34.     I'm no master programmer but couldn't you use some recursion to
  35. sort the strings individually....maybe pushing the characters at every 
  36. stage and then popping ans comparing.
  37.  
  38. I think I lost you, in which case...disreagrd this posting.
  39.  
  40. Naveed
  41.  
  42.