Show / Hide Table of Contents

Class QuickSort

An implementation of the quicksort algorithm.

Inheritance
System.Object
QuickSort
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class QuickSort

Methods

IsSorted(Func<Int64, Int64>, Int64, Int64)

Returns true if the given range is sorted.

Declaration
public static bool IsSorted(Func<long, long> value, long left, long right)
Parameters
Func<System.Int64, System.Int64> value

System.Int64 left

System.Int64 right

Returns
System.Boolean

Sort(Func<Int64, Int64>, Action<Int64, Int64>, Int64, Int64)

Executes a quicksort algorithm given the value and swap methods.

Declaration
public static void Sort(Func<long, long> value, Action<long, long> swap, long left, long right)
Parameters
Func<System.Int64, System.Int64> value

Action<System.Int64, System.Int64> swap

System.Int64 left

System.Int64 right

ThreewayPartition(Func<Int64, Int64>, Action<Int64, Int64>, Int64, Int64, Int64, out Int64, out Int64)

Partitions everything between left and right in three partitions, smaller than, equal to and larger than pivot.

Declaration
public static void ThreewayPartition(Func<long, long> value, Action<long, long> swap, long left, long right, long pivot, out long highestLowest, out long lowestHighest)
Parameters
Func<System.Int64, System.Int64> value

Action<System.Int64, System.Int64> swap

System.Int64 left

System.Int64 right

System.Int64 pivot

System.Int64 highestLowest

System.Int64 lowestHighest

Remarks

Reference : https://en.wikipedia.org/wiki/Dutch_national_flag_problem

ThreewayPartition(Func<Int64, Int64>, Action<Int64, Int64>, Int64, Int64, out Int64, out Int64)

Partitions everything between left and right in three partitions, smaller than, equal to and larger than pivot.

Declaration
public static void ThreewayPartition(Func<long, long> value, Action<long, long> swap, long left, long right, out long highestLowest, out long lowestHighest)
Parameters
Func<System.Int64, System.Int64> value

Action<System.Int64, System.Int64> swap

System.Int64 left

System.Int64 right

System.Int64 highestLowest

System.Int64 lowestHighest

Remarks

Reference : https://en.wikipedia.org/wiki/Dutch_national_flag_problem

Back to top Built by Itinero, MIT licensed.