Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b6fd43f

Browse files
committedOct 13, 2024·
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1aac369 commit b6fd43f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed
 

‎sorts/quantum_bogo_sort.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
def quantum_bogo_sort(arr: list[int]) -> list[int]:
22
"""
3-
Quantum Bogo Sort is a theoretical sorting algorithm that uses quantum
4-
mechanics to sort the elements. It is not practically feasible and is
5-
included here for humor.
3+
Quantum Bogo Sort is a theoretical sorting algorithm that uses quantum
4+
mechanics to sort the elements. It is not practically feasible and is
5+
included here for humor.
66
7-
More info:
7+
More info:
88
https://en.wikipedia.org/wiki/Bogosort#:~:text=achieve%20massive%20complexity.-,Quantum%20bogosort,-A%20hypothetical%20sorting
99
1010
:param arr: list[int] - The list of numbers to sort.
11-
:return: list[int] - The sorted list, humorously assumed to be
11+
:return: list[int] - The sorted list, humorously assumed to be
1212
instantly sorted using quantum superposition.
1313
1414
Example:
1515
>>> quantum_bogo_sort([2, 1, 4, 3])
1616
[1, 2, 3, 4]
17-
17+
1818
>>> quantum_bogo_sort([10, -1, 0])
1919
[-1, 0, 10]
20-
20+
2121
>>> quantum_bogo_sort([5])
2222
[5]
23-
23+
2424
>>> quantum_bogo_sort([])
2525
[]
2626
"""
27-
return sorted(arr) # Sorting is assumed to be done instantly via quantum superposition
27+
return sorted(
28+
arr
29+
) # Sorting is assumed to be done instantly via quantum superposition
2830

2931

3032
if __name__ == "__main__":

0 commit comments

Comments
 (0)
Please sign in to comment.