Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

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

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...