codebytes: 3-Way-Quicksort with Improvements [Tukey's Ninther]
1. If the number of elements is less than 10, use insertion sort.
2. If the number of elements is more, swap the first element with mid element.
3. If the number of elements is even more, swap the first element of the subarray with the median of the three elements (lo, mid, hi).
4. If the number of elements is even more, swap the first element with (Tukey's Ninther).
Read full article from codebytes: 3-Way-Quicksort with Improvements [Tukey's Ninther]
No comments:
Post a Comment