All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@harddata.com>
To: Martin Mares <mj@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: quicksort for linked list
Date: Sat, 10 Mar 2001 16:54:58 -0700	[thread overview]
Message-ID: <20010310165458.A7565@mail.harddata.com> (raw)
In-Reply-To: <3AA89624.46DBADD7@idb.hist.no> <200103091152.MAA31645@cave.bitwizard.nl> <20010309152902.A1219@mail.harddata.com> <20010310195006.A2670@albireo.ucw.cz>
In-Reply-To: <20010310195006.A2670@albireo.ucw.cz>; from Martin Mares on Sat, Mar 10, 2001 at 07:50:06PM +0100

On Sat, Mar 10, 2001 at 07:50:06PM +0100, Martin Mares wrote:
> Hello!
> 
> > Well, not really in this situation, after a simple modification.  It is
> > trivial to show that using "shorter interval sorted first" approach one
> > can bound an amount of an extra memory, on stack or otherwise, and by a
> > rather small number.
> 
> By O(log N) which is in reality a small number :)

Assuming that we sort a full range of 32-bit numbers (pointers on a
32-bit CPU, for example, are numbers of that kind but usually a range
can be narrowed down quite substantially) then with a bit of a careful
programming you need, I think, something like 16 extra 4-byte words or
maybe even a bit less.  I do not remember precisely, as I was doing this
exercise a long time ago, but even if this is 32, and you need carefuly
constructed example to need them all these extra cells, I still think
that this is not a huge amount of memory.  Especially when every element
of a list you are sorting is likely quite a bit bigger.

Exponents are something which grows these numbers pretty fast. :-)

  Michal

  reply	other threads:[~2001-03-10 23:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-09  7:38 quicksort for linked list Manoj Sontakke
2001-03-09  8:36 ` Helge Hafting
2001-03-09 11:09   ` James R Bruce
2001-03-09 11:50     ` Alan Cox
2001-03-09 18:39       ` Oliver Xymoron
2001-03-09 11:52   ` Rogier Wolff
2001-03-09 12:09     ` Thomas Pornin
2001-03-09 18:52     ` Oliver Xymoron
2001-03-10 16:15       ` Jerome Vouillon
2001-03-09 22:29     ` Michal Jaegermann
2001-03-10 18:50       ` Martin Mares
2001-03-10 23:54         ` Michal Jaegermann [this message]
2001-03-10 19:09     ` David Wragg
2001-03-12 19:20       ` Jamie Lokier
2001-03-13  6:59       ` James R Bruce
2001-03-09 18:23   ` Oliver Xymoron
2001-03-09 13:46 ` James Lewis Nance

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010310165458.A7565@mail.harddata.com \
    --to=michal@harddata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.