Sorting algorithms/Quicksort: Difference between revisions

Content added Content deleted
(Undo revision 330495 by CNHume (talk))
m (Reapplied prior datatype update.)
Line 1,789: Line 1,789:
public class QuickSort<T> where T : IComparable {
public class QuickSort<T> where T : IComparable {
#region Constants
#region Constants
public const Int32 INSERTION_LIMIT_DEFAULT = 12;
public const UInt32 INSERTION_LIMIT_DEFAULT = 12;
private const Int32 SAMPLES_MAX = 19;
private const Int32 SAMPLES_MAX = 19;
#endregion
#endregion


#region Properties
#region Properties
public Int32 InsertionLimit { get; }
public UInt32 InsertionLimit { get; }
private T[] Samples { get; }
private T[] Samples { get; }
private Int32 Left { get; set; }
private Int32 Left { get; set; }
Line 1,803: Line 1,803:


#region Constructors
#region Constructors
public QuickSort(Int32 insertionLimit = INSERTION_LIMIT_DEFAULT) {
public QuickSort(UInt32 insertionLimit = INSERTION_LIMIT_DEFAULT) {
this.InsertionLimit = insertionLimit;
this.InsertionLimit = insertionLimit;
this.Samples = new T[SAMPLES_MAX];
this.Samples = new T[SAMPLES_MAX];