comp.lang.ada
 help / color / mirror / Atom feed
* Anyone help develop an algorythm?
@ 1997-04-20  0:00 Matthew Givens
  1997-04-20  0:00 ` Robert A Duff
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Matthew Givens @ 1997-04-20  0:00 UTC (permalink / raw)



Okay, I have need for a special case sorting algorythm.  The best I've 
come up with is a streamlined, modified bubble sort, but performance 
isn't good enough, since I can have between 5000 and 15000 records.  
Here's the situation:

I have a linked list, each node corresponding to an array (contiguous in 
memory) of fixed length strings.  The default size of each array is 100, 
but that is user configurable and can change at run time.  So, call the 
size of the S and the length of each string in the array L.  Also, call 
the number of nodes in the linked list N.

Now, I have to sort these multiple nodes as if the whole shebang was a 
single, contiguous array.  The best I've been able to come up with is a 
modified Bubble Sort using page number as part of the looping structure.  
It looks a little weird, but it works.  Too slow, though.

This algorythm is for work, and I have to have it operational by the end 
of May.  Performance is a major consideration.

Any suggestions are appreciated.

-
If at first you don't succeed, destroy all evidence that you ever tried. 
<< Iceman >>





^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Anyone help develop an algorythm?
@ 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
  0 siblings, 2 replies; 22+ messages in thread
From: Marin David Condic, 561.796.8997, M/S 731-93 @ 1997-04-24  0:00 UTC (permalink / raw)



Joel VanLaven <jvl@OCSYSTEMS.COM>writes:
>Note that selection sort (still O(N^2)) is much better than bubble sort
>and is "just as simple".  It would also be easy to apply to your
>situation (as the primary sort).  Basically, if you are really using
>bubble sort, almost anything at all would be better.  Of course it might
>be that you are not using what I call a buuble sort.
>
    Of course, an alternate strategy is to always start development
    using the Slowsort(1) algorithm. Moving to almost anything
    else (including bubble sort) gets you an immediate improvement in
    performance and much customer satisfaction ;-))

    (1) Slowsort is an algorithm developed by myself & Bob Zaret in
    which you generate a random permutation of the list, then check to
    see if the list is sorted. If not, do it again... Behavior is
    O(N!). It was written up in Ada Letters many moons ago.

    MDC

Marin David Condic, Senior Computer Engineer    ATT:        561.796.8997
Pratt & Whitney, GESP                           Fax:        561.796.4669
West Palm Beach, FL                             Internet:   CONDICMA@PWFL.COM
===============================================================================
    "A verbal contract isn't worth the paper it's written on."

        --  Samuel Goldwyn
===============================================================================




^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~1997-04-29  0:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-20  0:00 Anyone help develop an algorythm? Matthew Givens
1997-04-20  0:00 ` Robert A Duff
1997-04-22  0:00   ` Steve Doiel
1997-04-20  0:00 ` Robert Dewar
1997-04-23  0:00   ` Matthew Givens
1997-04-23  0:00     ` Robert Dewar
1997-04-20  0:00 ` Joel VanLaven
1997-04-22  0:00   ` Robert Dewar
1997-04-20  0:00 ` Tucker Taft
1997-04-20  0:00 ` Tom Moran
1997-04-22  0:00   ` Michael F Brenner
     [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

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