We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93c6183 commit 43728a3Copy full SHA for 43728a3
sorts/cyclic_sort.py
@@ -14,12 +14,12 @@
14
15
def cyclic_sort(nums: list[int]) -> list[int]:
16
"""
17
- Sorts the input list in-place using the Cyclic Sort algorithm.
+ Sorts the input list of n integers from 1 to n in-place using the Cyclic Sort algorithm.
18
19
- :param nums: List of integers to be sorted.
+ :param nums: List of n integers from 1 to n to be sorted.
20
:return: The same list sorted in ascending order.
21
22
- Time complexity: O(n), where n is the number of elements in the list.
+ Time complexity: O(n), where n is the number of integers in the list.
23
24
Examples:
25
>>> cyclic_sort([])
0 commit comments