sorting, O(n^2) and O(n log(n))