Sorting algorithms, and complexity analysis