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