If you need some efficient sorting algorithm wrapped in a generic method, C5 has some in store for you. It has three sorting algorithms exposed as static methods of the class
Sorting, which are as follows:
All these sorting mechanisms operate on an array of
T, and all of these algorithms operate in-place. This means once you operate them on an array, you will be left with the sorted array and will lose the original unsorted array. We can use them to sort different collections as follows:
Pattern 1: Sorting an array of integers
IntroSort is an unstable version of
QuickSort that can be used in situations where
QuickSort fails to offer high performance, such as in the case of almost sorted collections. ...