Re: Mergesort algorithm for linked lists
- From: "Stephen Howe" <sjhoweATdialDOTpipexDOTcom>
- Date: Tue, 30 Jan 2007 15:05:18 -0000
The worst case for natural mergesort is
if the data is in reverse order to
start with. There are no "runs" then.
That's completely wrong for stable mergesorting of linked lists
and mostly wrong for stable mergesorting of arrays.
I was talking about *natural mergesort* not vanilla or ordinary mergesort.
I ought to make it clear that by worse case of natural mergesort, it is
still O(N * log N), it is just that natural mergesort does the most amount
of work in this case and the amount of auxilary memory is maximal.
Stephen Howe
.
- References:
- Re: Mergesort algorithm for linked lists
- From: Stephen Howe
- Re: Mergesort algorithm for linked lists
- From: pete
- Re: Mergesort algorithm for linked lists
- Prev by Date: Re: Other than php/perl/lisp/c/c++/java, anybody have a favorite computer-programming language?
- Next by Date: Re: Mergesort algorithm for linked lists
- Previous by thread: Re: Mergesort algorithm for linked lists
- Next by thread: Bitwise 2K7 - An Algorithm Intensive Time Constrained Online Programming Competition.
- Index(es):