Skip to content

Commit 85f2e81

Browse files
committed
Update sorts/quick_sort_3_partition.py
rename quick_sort_3partition to quick_sort_3part
1 parent a30a283 commit 85f2e81

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: sorts/quick_sort_3_partition.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ def quick_sort_3partition(sorting: list, left: int, right: int) -> list:
1818
quick_sort_3partition(sorting, b + 1, right)
1919

2020

21-
def quick_sort_3partition(sorting: list) -> list:
21+
def quick_sort_3part(sorting: list) -> list:
2222
"""
2323
Another quick sort algorithm, returns a new sorted list
2424
25-
>>> quick_sort_3partition([])
25+
>>> quick_sort_3part([])
2626
[]
27-
>>> quick_sort_3partition([1])
27+
>>> quick_sort_3part([1])
2828
[1]
29-
>>> quick_sort_3partition([-5, -2, 1, -2, 0, 1])
29+
>>> quick_sort_3part([-5, -2, 1, -2, 0, 1])
3030
[-5, -2, -2, 0, 1, 1]
31-
>>> quick_sort_3partition([1, 2, 5, 1, 2, 0, 0, 5, 2, -1])
31+
>>> quick_sort_3part([1, 2, 5, 1, 2, 0, 0, 5, 2, -1])
3232
[-1, 0, 0, 1, 1, 2, 2, 2, 5, 5]
3333
"""
3434
if len(sorting) <= 1:
3535
return sorting
3636
return (
37-
quick_sort_3partition([i for i in sorting if i < sorting[0]])
37+
quick_sort_3part([i for i in sorting if i < sorting[0]])
3838
+ [i for i in sorting if i == sorting[0]]
39-
+ quick_sort_3partition([i for i in sorting if i > sorting[0]])
39+
+ quick_sort_3part([i for i in sorting if i > sorting[0]])
4040
)
4141

4242

0 commit comments

Comments
 (0)