Newsgroups: comp.sys.mac.programmer.help,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!dsinc!spool.mu.edu!uwm.edu!cs.utexas.edu!math.ohio-state.edu!usc!news.isi.edu!gremlin!shomase!jbarnett
From: jbarnett@charming.nrtc.northrop.com (Jeff Barnett)
Subject: Re: Mergesort: why's it efficient?
Message-ID: <E1553u.B1s@gremlin.nrtc.northrop.com>
Sender: news@gremlin.nrtc.northrop.com (Usenet News Manager)
Reply-To: jbarnett@charming.nrtc.northrop.com
Organization: Northrop Automation Sciences Laboratory
References: <joost-1711962140550001@news.sirius.com> <x5pw1b9ld8.fsf@rsi.jhuapl.edu> <56s84c$rfp@isoit109.bbn.hp.com>
Date: Tue, 19 Nov 1996 23:26:17 GMT
Lines: 12
Xref: glinda.oz.cs.cmu.edu comp.sys.mac.programmer.help:43702 comp.lang.lisp:23818

In article <56s84c$rfp@isoit109.bbn.hp.com>, jensk@bbn.hp.com (Jens Kilian) writes:
|> Marty Hall (hall@apl.jhu.edu) wrote:
|> Also, Mergesort can exploit existing order in the input, in the best case
|> achieving O(N) performance.

I think that merge sort still makes log n passes over the total input
AND each pass will take O(n) time.  Thus, the time performance of merge
sort is extremely independent of the original order.  However, I think
QUICK sort and many others vary between O(n) and O(N^2) depending on
the original order.

Jeff Barnett
