File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def quick_sort(arr: List[int]) -> List[int]:
2121 return quick_sort (left ) + middle + quick_sort (right )
2222
2323
24- def quick_sort_3way (arr : List [int ], low : int = 0 , high : Optional [int ] = None ) -> List [int ]:
24+ def quick_sort_3way (
25+ arr : List [int ], low : int = 0 , high : Optional [int ] = None
26+ ) -> List [int ]:
2527 """
2628 In-place 3-way partitioning quick sort.
2729
@@ -71,8 +73,12 @@ def test_quick_sorts():
7173 ]
7274
7375 for i , (input_arr , expected ) in enumerate (test_cases ):
74- assert quick_sort (input_arr ) == expected , f"quick_sort failed on test case { i + 1 } "
75- assert quick_sort_3way (input_arr .copy ()) == expected , f"quick_sort_3way failed on test case { i + 1 } "
76+ assert quick_sort (input_arr ) == expected , (
77+ f"quick_sort failed on test case { i + 1 } "
78+ )
79+ assert quick_sort_3way (input_arr .copy ()) == expected , (
80+ f"quick_sort_3way failed on test case { i + 1 } "
81+ )
7682
7783 print ("All tests passed!" )
7884
You can’t perform that action at this time.
0 commit comments