Exemple #1
0
 /// <summary>
 /// Sorts the given <see cref="IList{T}"/> using the <see cref="IComparer{T}"/>.
 /// This method uses the intro sort
 /// algorithm, but falls back to insertion sort for small lists.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="list">this <see cref="IList{T}"/></param>
 public static void IntroSort <T>(this IList <T> list)
 {
     CollectionUtil.IntroSort(list);
 }
Exemple #2
0
 /// <summary>
 /// Sorts the given <see cref="IList{T}"/> using the <see cref="IComparer{T}"/>.
 /// This method uses the intro sort
 /// algorithm, but falls back to insertion sort for small lists.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="list">this <see cref="IList{T}"/></param>
 /// <param name="comparer">The <see cref="IComparer{T}"/> to use for the sort.</param>
 public static void IntroSort <T>(this IList <T> list, IComparer <T> comparer)
 {
     CollectionUtil.IntroSort(list, comparer);
 }
Exemple #3
0
 /// <summary>
 /// Sorts the given <see cref="IList{T}"/> using the <see cref="IComparer{T}"/>.
 /// This method uses the Tim sort
 /// algorithm, but falls back to binary sort for small lists.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="list">this <see cref="IList{T}"/></param>
 public static void TimSort <T>(this IList <T> list)
 {
     CollectionUtil.TimSort(list);
 }