Implementing sorts for Comparables and Arrays