Recursive selection sort in C#

A C# version of the selection sort inspired by the way it’s commonly done in Scala https://github.com/CSGrimey/MiscSnippets/blob/master/Code/Algorithms/SelectionSorter.cs

Advertisements

Insertion sort in C#

Following the same theme as the last two posts, here is a Scala style implementation of the insertion sort in C# https://github.com/CSGrimey/MiscSnippets/blob/master/Code/Algorithms/InsertionSorter.cs

The code for this is way simpler than I expected. The bubble sort is supposed to be one of the simplest sorting algorithms, yet the code is a lot more involved than this insertion sort code.