Guest Posted May 24, 2011 Report Share Posted May 24, 2011 i'm looking for a sort function with the following properties. a) best case n b) worst case n* log(2) n basically, if an array is already sorted, or nearly sorted, both merge sort and heap sort require n* log(2) n iterations before halting. (heap sort more so than merge sort.) i've been working on the problem over the past few days trying to come up with my own sorting function, but as of yet, no luck. any ideas? Quote Link to comment Share on other sites More sharing options...
Question
Guest
i'm looking for a sort function with the following properties.
a) best case n
b) worst case n* log(2) n
basically, if an array is already sorted, or nearly sorted, both merge sort and heap sort require n* log(2) n iterations before halting.
(heap sort more so than merge sort.)
i've been working on the problem over the past few days trying to come up with my own sorting function, but as of yet, no luck. any ideas?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.