Insertion Sort in C#: A Generic, Span-Based Implementation
Insertion sort in modern C# for any comparable type, why it beats quick sort on small or nearly sorted arrays, and where .NET itself uses it.
Insertion sort in modern C# for any comparable type, why it beats quick sort on small or nearly sorted arrays, and where .NET itself uses it.
Selection sort in modern C# for any comparable type, a fix for a common mistake in older versions, and the one case where it beats other simple sorts.