摘要:
快速排序法 import java.util.Arrays; public class Algorithm { public static void main(String[] args) { int[] arr = {1,3,5,7,2,4,6,8}; System.out.println(Arr 阅读全文
posted @ 2021-10-24 15:05
振袖秋枫问红叶
阅读(25)
评论(0)
推荐(0)
摘要:
import java.util.Arrays; public class Algorithm { public static void main(String[] args) { int[] arr = {1,3,5,7,2,4,6,8}; System.out.println(Arrays.to 阅读全文
posted @ 2021-10-24 14:58
振袖秋枫问红叶
阅读(32)
评论(0)
推荐(0)
摘要:
双指针法(双路快速排序法) class Solution { public int findKthLargest(int[] nums, int k) { /** * 第k大的元素等同于第length - k小的元素 */ int target = nums.length - k; return s 阅读全文
posted @ 2021-10-24 14:43
振袖秋枫问红叶
阅读(51)
评论(0)
推荐(0)