Example #1
0
 /// <summary>
 ///     Performs sort using Merge Sort algorithm.
 ///     Performance:
 ///     Best:       O(n * Log(n))
 ///     Worst:      O(n * Log(n))
 ///     Average:    O(n * Log(n))
 ///     Not In Place
 ///     Not Stable
 /// </summary>
 /// <typeparam name="T">Type contained in the collection</typeparam>
 /// <param name="options"></param>
 /// <param name="comparer">Comparer for type T</param>
 /// <returns></returns>
 public static SortOptions <T> UseMergeSort <T>(this SortOptions <T> options, Func <T, T, int> comparer)
 {
     return(options.UseMergeSort(new LambdaComparer <T>(comparer)));
 }
Example #2
0
 /// <summary>
 ///     Performs sort using Merge Sort algorithm.
 ///     Performance:
 ///     Best:       O(n * Log(n))
 ///     Worst:      O(n * Log(n))
 ///     Average:    O(n * Log(n))
 ///     Not In Place
 ///     Not Stable
 /// </summary>
 /// <typeparam name="T">Type contained in the collection</typeparam>
 /// <typeparam name="TComparer">IComparer implementation for type T</typeparam>
 /// <param name="options"></param>
 /// <returns></returns>
 public static SortOptions <T> UseMergeSort <T, TComparer>(this SortOptions <T> options)
     where TComparer : IComparer <T>, new()
 {
     return(options.UseMergeSort(new TComparer()));
 }