You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your initial implementation of the `sorter` function uses bubble sort, which is not the most efficient sorting algorithm. We can improve the performance by using Python's built-in sorting function, which uses Timsort (a hybrid sorting algorithm derived from merge sort and insertion sort).
The built-in `sort()` method is optimized and runs in O(n log n) time complexity, making the function significantly faster for large lists compared to the O(n^2) time complexity of bubble sort.
0 commit comments