-
December 6th, 2004, 06:35 PM
#1
quick, heap, and merge sorts comparison
On the basis of their actual run-time formulas (not just their O-notation), what is the order of the average case running times of Heap sort, Merge sort, and Quciksort from fastest to slowest? I know that Heap sort is faster than merge sort, so the real quest is, which is fastest between Merge sort and Quicksort?
Last edited by bdadbin; December 6th, 2004 at 07:22 PM.
-
December 6th, 2004, 09:29 PM
#2
Re: quick, heap, and merge sorts comparison
And yet another.....
Don't you believe in doing any honest work yourself. Write some code, measure the results, analyze the various standard implementations,
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
December 7th, 2004, 03:41 AM
#3
Re: quick, heap, and merge sorts comparison
oh i agree w/ you 100%, but it would be impractical to do so considering its finals week and im trying to cram for finals ... thanks for your smart *** remark, though ...it did me a lot of help.
Last edited by bdadbin; December 7th, 2004 at 03:44 AM.
-
December 7th, 2004, 10:39 AM
#4
Re: quick, heap, and merge sorts comparison
So, perform the experiment after finals. Unless, this is really a schoolwork related question.
Viggy
-
December 7th, 2004, 10:57 AM
#5
Re: quick, heap, and merge sorts comparison
This is really dependant on the data and how they're ordered in the (unsorted) array (as well as factors such as computer speed, compiler used, language used, optimizations used, the mood you're in when you're writing the test cases, etc.). As a (very) general case, quicksort is generally faster out of the 3, however it does have a worst-case running-time so it's also the slowest of the three.
Last edited by cma; December 7th, 2004 at 11:01 AM.
Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html
-
December 7th, 2004, 01:10 PM
#6
Re: quick, heap, and merge sorts comparison
To MrViggy, this is for finals. And to cma, thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|