Re: Quicksort
- From: Adak <adak_dave@xxxxxxxxxxxxx>
- Date: Sun, 6 Jan 2008 22:17:36 -0800 (PST)
On Jan 6, 5:49 am, Roman Töngi <roman.toe...@xxxxxxxxxx> wrote:
Quicksort is a typical recursive procedure.
It can, of course, also be implemented iteratively
by remembering the indices (left, right) with a stack.
So, there should be no significant gain in storage space
(compared to the systems local stack) but in speed because there
are no function calls.
Is this thinking justified?
Not imo. I've tested an iterative version of Quicksort, and it was
just slightly faster. IMO it wasn't
worth the bother of ensuring that the stack space was adequate. Also,
the recursive version is a beauty.
The iterative version is certainly not.
.
- Follow-Ups:
- Re: Quicksort
- From: robertwessel2@xxxxxxxxx
- Re: Quicksort
- References:
- Quicksort
- From: Roman Töngi
- Quicksort
- Prev by Date: Re: Brian Kernighan, maybe I'm not worthy, maybe I'm scum
- Next by Date: Re: Brian Kernighan, maybe I'm not worthy, maybe I'm scum
- Previous by thread: Re: Quicksort
- Next by thread: Re: Quicksort
- Index(es):
Relevant Pages
|