From: Jean-Marc Bourguet <jm@bourguet.org>
Subject: Re: list strawman
Date: 08 Jan 2002 18:21:35 +0100
Date: 2002-01-08T18:21:37+01:00 [thread overview]
Message-ID: <3c3b2aa0$0$212$626a54ce@news.free.fr> (raw)
In-Reply-To: sHF_7.8807$cD4.16831@www.newsranger.com
Ted Dennison<dennison@telepath.com> writes:
> In article <3c3b13ba$0$212$626a54ce@news.free.fr>, Jean-Marc Bourguet says...
> >
> >How do you do quicksort on a list? quicksort assume random access so
> >you'll have O(n) space overhead. I'd use a merge sort on a list which
> >would have the same complexity as quicksort and do not need random
> >access.
>
> I don't see that.
I'm sorry, I was thinking about heap sort.
> The way it works, all you have to keep track of is the ends of the
> list (or sublist you are working on), the pivot point, and a couple
> of pointers that iterate through the list. There's nothing in there
> that can't be done easily with a doubly-linked list.
Yes. There is still the problem of choosing the pivot. With random
access, I'd use a random element. Without random access, you'll have
to choose the first or the last element and then degenerate in N^2 for
a sorted input, not something I'd like in a general purpose library.
Well taking a random element is possible but at a cost of iterating
some more time on the whole list. Perhaps there is a way to even
choose the next pivot while you construct the upper and lower list but
I don't see one.
Well, I think I'd still choose a merge sort.
Yours,
--
Jean-Marc
next prev parent reply other threads:[~2002-01-08 17:21 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-06 20:55 list strawman Stephen Leake
2002-01-07 15:56 ` Ted Dennison
2002-01-07 15:57 ` Ted Dennison
2002-01-07 16:33 ` Stephen Leake
2002-01-07 16:37 ` Stephen Leake
2002-01-07 19:31 ` Ted Dennison
2002-01-07 19:26 ` Ted Dennison
2002-01-07 22:05 ` Stephen Leake
2002-01-07 22:51 ` Ted Dennison
2002-01-08 0:48 ` Steven Deller
2002-01-08 15:32 ` Ted Dennison
2002-01-08 15:43 ` Jean-Marc Bourguet
2002-01-08 17:07 ` Ted Dennison
2002-01-08 17:21 ` Jean-Marc Bourguet [this message]
2002-01-08 19:12 ` Ted Dennison
2002-01-09 8:09 ` Jean-Marc Bourguet
2002-01-09 18:37 ` Ted Dennison
2002-01-11 9:37 ` Jean-Marc Bourguet
2002-01-11 17:03 ` Ted Dennison
2002-01-11 17:47 ` Jeffrey Carter
2002-01-12 15:10 ` Jean-Marc Bourguet
2002-01-13 10:18 ` Jean-Marc Bourguet
2002-01-14 16:02 ` Ted Dennison
2002-01-14 16:22 ` Jean-Marc Bourguet
2002-01-08 19:57 ` Steven Deller
2002-01-08 19:54 ` Steven Deller
2002-01-08 19:54 ` Steven Deller
2002-01-08 20:46 ` Ted Dennison
2002-01-08 21:21 ` Stephen Leake
2002-01-08 21:49 ` Ted Dennison
2002-01-09 9:21 ` Thomas Wolf
2002-01-09 15:20 ` Ted Dennison
2002-01-09 15:53 ` Stephen Leake
2002-01-09 21:21 ` Ted Dennison
2002-01-09 17:42 ` Mark Lundquist
2002-01-09 21:02 ` Jeffrey Carter
2002-01-10 8:47 ` Thomas Wolf
2002-01-11 17:38 ` Jeffrey Carter
2002-01-11 21:52 ` Chad Robert Meiners
2002-01-12 5:45 ` Jeffrey Carter
2002-01-12 22:20 ` Chad R. Meiners
2002-01-13 17:03 ` Jeffrey Carter
2002-01-13 23:47 ` Chad R. Meiners
2002-01-14 1:32 ` Ted Dennison
2002-01-14 5:12 ` Jeffrey Carter
2002-01-14 5:12 ` Jeffrey Carter
2002-01-10 14:39 ` Ted Dennison
2002-01-11 5:34 ` Mark Biggar
2002-01-12 12:20 ` Simon Wright
2002-01-14 14:53 ` Matthew Heaney
2002-01-16 5:56 ` Simon Wright
2002-01-18 9:15 ` Overridability of _private_ predefined "=" [was Re: list strawman] Vincent Marciante
2002-01-19 16:58 ` Vincent Marciante
2002-01-19 22:42 ` Nick Roberts
2002-01-09 3:10 ` list strawman Ted Dennison
2002-01-09 19:09 ` Ted Dennison
2002-01-08 21:26 ` Georg Bauhaus
2002-01-08 22:13 ` Ted Dennison
2002-01-09 20:52 ` Jeffrey Carter
2002-02-17 15:04 ` Florian Weimer
2002-02-17 15:05 ` Florian Weimer
2002-02-18 1:43 ` Stephen Leake
2002-02-18 8:57 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox