Sorting algorithms/Quicksort: Difference between revisions
Content deleted Content added
m Guarded against Arithmetic Overflow. |
m Removed dependency on C# 9 init methods from properties. |
||
Line 1,776:
=={{header|C sharp|C#}}==
<lang csharp>//
// The Tripartite conditional enables Bentley-McIlroy 3-way Partitioning.
Line 1,795 ⟶ 1,794:
#region Properties
public Int32 InsertionLimit { get
private T[] Samples { get
private Int32 Left { get; set; }
private Int32 Right { get; set; }
Line 1,857 ⟶ 1,856:
/// <summary>Estimate the median value of entries[Left:Right]</summary>
/// <remarks>
private T pivot(T[] entries) {
var length = Right + 1 - Left;
Line 1,869 ⟶ 1,868:
InsertionSort<T>.Sort(Samples, 0, samples - 1);
}
|