Python Sorting Time Complexity