Sorting algorithms/Quicksort: Difference between revisions

Undo revision 330495 by CNHume (talk)
m (Minor datatype adjustment.)
(Undo revision 330495 by CNHume (talk))
Line 1,795:
#region Properties
public Int32 InsertionLimit { get; }
private T[] Samples { get; }
private Int32 Left { get; set; }
private Int32 Right { get; set; }
private Int32 LeftMedian { get; set; }
private Int32 RightMedian { get; set; }
#endregion
//
// The Tripartite conditional enables Bentley-McIlroy 3-way Partitioning.
// This performs additional compares to isolate islands of keys equal to
// the pivot value. Use unless key-equivalent classes are of small size.
//
#define Tripartite
 
namespace RosettaCode {
using System;
using System.Diagnostics;
 
public class QuickSort<T> where T : IComparable {
#region Constants
public const UInt32 INSERTION_LIMIT_DEFAULT = 12;
private const Int32 SAMPLES_MAX = 19;
#endregion
 
#region Properties
public UInt32 InsertionLimit { get; }
private T[] Samples { get; }
private Int32 Left { get; set; }
Line 1,828 ⟶ 1,803:
 
#region Constructors
public QuickSort(UInt32Int32 insertionLimit = INSERTION_LIMIT_DEFAULT) {
this.InsertionLimit = insertionLimit;
this.Samples = new T[SAMPLES_MAX];
159

edits