Basic sorting algorithms in C#