Quicksort vs. Shell
|
06-17-2014, 08:32 PM
Post: #13
|
|||
|
|||
RE: Quicksort vs. Shell
(06-17-2014 06:51 PM)Werner Wrote:(06-17-2014 06:07 PM)Claudio L. Wrote: So log2(N) is a best-case scenario, N-1 is the worst-case, and in reality it's somewhere in between. Even with more advanced pivot picking techniques, there's always the chance that a wickedly-sorted list makes you hit the worst case. Yes, I just read about that trick a few moments ago. It's also recommended not to recurse the second half, but do a tail call, so no stack is used. So it's not so bad after all, I can live with log2(N). I'll give it a shot. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)