
Sort
CrazyAoli
这个作者很懒,什么都没留下…
展开
-
[MergeSort]LintCode463. Sort Integers
public class Solution { public void sortIntegers(int[] A) { if (A == null || A.length == 0) { return; } int[] temp = new int[A.length]; mergeSort(A, 0, A.length - 1, temp); } private void mergeSo原创 2021-02-11 12:11:11 · 219 阅读 · 0 评论 -
[QuickSort]LintCode463. Sort Integers
463. Sort Integers Given an integer array, sort it in ascending order. Use selection sort, bubble sort, insertion sort or any O(n2) algorithm. 样例 Example 1: Input: [3, 2, 1, 4, 5] Output: [1, 2, 3, 4, 5] Explanation: return the sorted array. Example 2:原创 2021-02-08 09:25:22 · 136 阅读 · 0 评论