From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,50880f040eb869b4 X-Google-Attributes: gid103376,public From: NKSW39B@prodigy.com (Matthew Givens) Subject: Re: Anyone help develop an algorythm? Date: 1997/04/29 Message-ID: <5k3fqv$1o9e@newssvr01-int.news.prodigy.com>#1/1 X-Deja-AN: 238018016 Distribution: world References: <5jddg7$uf0@newssvr01-int.news.prodigy.com> <335af137.54d7@bix.com> <5k141n$2r1k@newssvr01-int.news.prodigy.com> Organization: Prodigy Services Company 1-800-PRODIGY Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) wrote: > >Matthew said > ><<>Your problem statement is unclear. Are you saying your linked list has >>N nodes, at each node is an array of some number of elements, each >>element is a string of (equal) length L, and you want to treat is as a >>great big array of strings of length L and you want to sort that big >>array?P>> > >Yes exactly>> > > >The question is what form do you want the output in? Do you want to >construct an array of poiners? If so, then it is trivial to sort the >array of pointers, using any standard sorting algorithm. Or do you want >to sort in place keeping the linked list structure throughout -- in >that case a modified mrge sort is the only feasible answer (modified >to deal with the multi-element nodes). The structure of the data can't change. The data must be sorted in place, not merged into a single list. And the only merge sorts I know actually merge the data into a single list. Just how do you modify a merge sort to sort the data in place? - If at first you don't succeed, destroy all evidence that you ever tried. << Iceman >>