Skip to content

Commit 43728a3

Browse files
Update cyclic_sort.py
1 parent 93c6183 commit 43728a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sorts/cyclic_sort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
def cyclic_sort(nums: list[int]) -> list[int]:
1616
"""
17-
Sorts the input list in-place using the Cyclic Sort algorithm.
17+
Sorts the input list of n integers from 1 to n in-place using the Cyclic Sort algorithm.
1818
19-
:param nums: List of integers to be sorted.
19+
:param nums: List of n integers from 1 to n to be sorted.
2020
:return: The same list sorted in ascending order.
2121
22-
Time complexity: O(n), where n is the number of elements in the list.
22+
Time complexity: O(n), where n is the number of integers in the list.
2323
2424
Examples:
2525
>>> cyclic_sort([])

0 commit comments

Comments
 (0)