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 1aac369

Browse files
authoredOct 13, 2024··
Update quantum_bogo_sort.py line too long error resolved
1 parent 4a9404f commit 1aac369

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎sorts/quantum_bogo_sort.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
def quantum_bogo_sort(arr: list[int]) -> list[int]:
22
"""
3-
Quantum Bogo Sort is a theoretical sorting algorithm that uses quantum mechanics to sort the elements.
4-
It is not practically feasible and is 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.
56
6-
Reference:
7+
More info:
78
https://en.wikipedia.org/wiki/Bogosort#:~:text=achieve%20massive%20complexity.-,Quantum%20bogosort,-A%20hypothetical%20sorting
89
910
:param arr: list[int] - The list of numbers to sort.
10-
:return: list[int] - The sorted list, humorously assumed to be instantly sorted using quantum superposition.
11+
:return: list[int] - The sorted list, humorously assumed to be
12+
instantly sorted using quantum superposition.
1113
1214
Example:
1315
>>> quantum_bogo_sort([2, 1, 4, 3])
1416
[1, 2, 3, 4]
15-
17+
1618
>>> quantum_bogo_sort([10, -1, 0])
1719
[-1, 0, 10]
18-
20+
1921
>>> quantum_bogo_sort([5])
2022
[5]
21-
23+
2224
>>> quantum_bogo_sort([])
2325
[]
2426
"""
25-
return sorted(
26-
arr
27-
) # Sorting is assumed to be done instantly via quantum superposition
27+
return sorted(arr) # Sorting is assumed to be done instantly via quantum superposition
2828

2929

3030
if __name__ == "__main__":

0 commit comments

Comments
 (0)
Please sign in to comment.