Exemplo n.º 1
0
 /// <summary>
 /// Initializes a <see cref="QuickSort{T}"/> class.
 /// </summary>
 /// <param name="comparer">The <see cref="IComparer{T}"/> to use for all sorting comparisons.</param>
 /// <remarks>Defaults the alternate sorting algorithm to <see cref="InsertionSort{T}"/>.</remarks>
 public QuickSort(IComparer <T> comparer) : base(comparer)
 {
     InParallel           = false;
     _parallelInvokeCalls = 0;
     _sorting             = false;
     _threshold           = _DefaultThreshold;
     _thresholdSort       = new InsertionSort <T>(_comparer);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a <see cref="IntroSort{T}"/> class.
 /// </summary>
 /// <param name="comparer">The <see cref="IComparer{T}"/> to use for all sorting comparisons.</param>
 public IntroSort(IComparer <T> comparer) : base(comparer)
 {
     _insertionSort = new InsertionSort <T>(_comparer);
     _heapSort      = new HeapSort <T>(_comparer);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a <see cref="IntroSort{T}"/> class.
 /// </summary>
 public IntroSort()
 {
     _insertionSort = new InsertionSort <T>(_comparer);
     _heapSort      = new HeapSort <T>(_comparer);
 }