Update c# sorting algorithms to use generics