Sorting algorithms code in C#