← 返回 bloomberg 的题目列表Medium-Level Sorting Algorithm
类型:online_judge
Given an array of integers, implement a sorting algorithm to arrange the elements in ascending order. Write the implementation and analyze its time and space complexity. Provide test cases.
Example Test Case:
Input: nums = [4, 2, 5, 1, 3]
Output: [1, 2, 3, 4, 5]
Constraints: 1 <= nums.length <= 1000, -1000 <= nums[i] <= 1000.
Example
Input
4 2 5 1 3