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
⚡️ Speed up method BubbleSortClass.sorter by 55,130%
Here's a much faster version, using Python's built-in `sort` method which is highly optimized (Timsort, O(n log n) worst case), instead of Bubble Sort (O(n²)). This drastically improves speed and uses less memory and CPU cycles.
**Notes**.
- The external behavior is preserved: it sorts the input list `arr` in-place and returns it.
- Built-in `.sort()` uses Timsort and is optimal for nearly all practical cases.
- All comments and function signatures are preserved.
0 commit comments