Divides the input list into smaller lists, sorts those smaller lists, and then merges them back together in a sorted manner.

Implementation

Usage

List<int> result = new[] { 5, 4, 3, 2, 1 }.MergeSort();

int[] input = new[] { 5, 4, 3, 2, 1 };
input.MergeSort();

Benchmarks

dotnet run --project ./Benchmarks/Benchmarks.csproj -c Release -- --job short --memory --f *MergeSort*

Tests