comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Anyone help develop an algorythm?
Date: 1997/04/20
Date: 1997-04-20T00:00:00+00:00	[thread overview]
Message-ID: <E8yGpJ.Dyu@world.std.com> (raw)
In-Reply-To: 5jddg7$uf0@newssvr01-int.news.prodigy.com


In article <5jddg7$uf0@newssvr01-int.news.prodigy.com>,
Matthew Givens <NKSW39B@prodigy.com> wrote:
>I have a linked list, each node corresponding to an array (contiguous in 
>memory) of fixed length strings. ...

Perhaps you should construct an array on the side, containing pointers
to all the strings.  Then sort that, using your favorite (fast) sorting
algorithm.

Constructing the array can be done in linear time.  You can walk the
list once to determine the size of the array.  Or perhaps your program
already knows the size.  Or perhaps it knows some reasonable upper bound
on the size.  Then walk the list again, putting pointers to each string
in the array.  (The strings need to be "aliased".)  Then do the sort.

- Bob




  parent reply	other threads:[~1997-04-20  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-20  0:00 Anyone help develop an algorythm? Matthew Givens
1997-04-20  0:00 ` Tucker Taft
1997-04-20  0:00 ` Tom Moran
1997-04-22  0:00   ` Michael F Brenner
1997-04-20  0:00 ` Robert A Duff [this message]
1997-04-22  0:00   ` Steve Doiel
1997-04-20  0:00 ` Joel VanLaven
1997-04-22  0:00   ` Robert Dewar
1997-04-20  0:00 ` Robert Dewar
1997-04-23  0:00   ` Matthew Givens
1997-04-23  0:00     ` Robert Dewar
     [not found] ` <e8yijs.fg1.0.-s@inmet.camb.inmet.com>
1997-04-23  0:00   ` Matthew Givens
1997-04-23  0:00     ` Robert Dewar
1997-04-28  0:00       ` Matthew Givens
1997-04-23  0:00     ` Tucker Taft
     [not found] ` <335af137.54d7@bix.com>
1997-04-28  0:00   ` Matthew Givens
1997-04-28  0:00     ` Robert Dewar
1997-04-29  0:00       ` Matthew Givens
  -- strict thread matches above, loose matches on Subject: below --
1997-04-24  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-04-25  0:00 ` Michael F Brenner
1997-04-28  0:00   ` Matthew Givens
1997-04-28  0:00 ` Matthew Givens
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox