Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 1.37 KB

0912-sort-an-array.adoc

File metadata and controls

58 lines (36 loc) · 1.37 KB

912. Sort an Array

{leetcode}/problems/sort-an-array/[LeetCode - Sort an Array^]

Given an array of integers nums, sort the array in ascending order.

Example 1:

Input: nums = [5,2,3,1]
Output: [1,2,3,5]

Example 2:

Input: nums = [5,1,1,2,0,0]
Output: [0,0,1,1,2,5]

Constraints:

  • 1 ⇐ nums.length ⇐ 50000

  • -50000 ⇐ nums[i] ⇐ 50000

思路分析

归并排序

{image_attr}
{image_attr}
{image_attr}
{image_attr}
{image_attr}
{image_attr}
link:{sourcedir}/_0912_SortAnArray.java[role=include]