Skip to content

Commit 4205db1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ec3132e commit 4205db1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sorts/kirkpatrick_reisch_sort.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def kirkpatrick_reisch_sort(arr):
4949
return arr
5050

5151
# Step 1: Divide the input into sqrt(n) blocks
52-
block_size = int(n ** 0.5)
53-
blocks = [arr[i:i + block_size] for i in range(0, n, block_size)]
52+
block_size = int(n**0.5)
53+
blocks = [arr[i : i + block_size] for i in range(0, n, block_size)]
5454

5555
# Step 2: Sort each block
5656
for block in blocks:
@@ -73,7 +73,7 @@ def kirkpatrick_reisch_sort(arr):
7373
return sorted_arr
7474

7575

76-
if __name__ == '__main__':
76+
if __name__ == "__main__":
7777
# Generate a random list of integers
7878
arr = [random.randint(1, 1000) for _ in range(100)]
7979

@@ -82,4 +82,4 @@ def kirkpatrick_reisch_sort(arr):
8282
print("Sorted Array:", sorted_arr)
8383

8484
# Verify the result
85-
assert (sorted_arr == sorted(arr))
85+
assert sorted_arr == sorted(arr)

0 commit comments

Comments
 (0)