Skip to content

Commit

Permalink
⚡️ Speed up function sorter by 30,125%
Browse files Browse the repository at this point in the history
Test DGDGDDGD increase the speed of this function by switching to a more efficient sorting algorithm like Timsort, which is the default sorting algorithm used in Python. Here's the optimized version.

 

This utilizes Python's built-in `sort` method, which is highly efficient with a time complexity of O(n log n).
  • Loading branch information
codeflash-ai[bot] authored Feb 14, 2025
1 parent 97f70aa commit 10fcb0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/code_to_optimize/bubble_sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def sorter(arr):
arr.sort()
return arr

0 comments on commit 10fcb0b

Please sign in to comment.