Re: In-place algorithm
- From: Juha Nieminen <nospam@xxxxxxxxxxxxxx>
- Date: Sat, 24 May 2008 16:36:21 GMT
Ben Bacarisse wrote:
As to the OP's original question, I doubt that any list-based sort
meets their definition of "in place". Even using the "needs O(1)
extra space" definition, just using a list requires O(N) extra space
in some sense.
I think that the spirit of the request is that the algorithm should
not take additional memory besides what the list already is taking. In
other words, no more than O(1) amount of memory is allocated for the
merge sort algorithm itself.
Granted, technically speaking merge sort always requires additional
memory to work. But in the case of a doubly-linked list the existing
pointers can be used as this additional memory, so no additional memory
*besides them* is needed.
.
- Follow-Ups:
- Re: In-place algorithm
- From: CBFalconer
- Re: In-place algorithm
- References:
- In-place algorithm
- From: fattorare
- Re: In-place algorithm
- From: Stephen Howe
- Re: In-place algorithm
- From: Juha Nieminen
- Re: In-place algorithm
- From: CBFalconer
- Re: In-place algorithm
- From: Juha Nieminen
- Re: In-place algorithm
- From: Ben Bacarisse
- In-place algorithm
- Prev by Date: Re: In-place algorithm
- Next by Date: Re: In-place algorithm
- Previous by thread: Re: In-place algorithm
- Next by thread: Re: In-place algorithm
- Index(es):
Relevant Pages
|
|