摘要:
方法一: 动态规划 (O(n)) class Solution { public int lengthOfLIS(int[] nums) { int n = nums.length; if(n < 2) return n; int[] dp = new int[n+1]; // dp[i] : 以第 阅读全文
posted @ 2020-07-08 11:50
Sexyomaru
阅读(149)
评论(0)
推荐(0)
摘要:
两种复杂度O(n)的方法 方法一:快速选择 class Solution { public int findKthLargest(int[] nums, int k) { int lo = 0, hi = nums.length - 1; // 当前partition 函数的区间边界 int tar 阅读全文
posted @ 2020-07-08 11:44
Sexyomaru
阅读(134)
评论(0)
推荐(0)

浙公网安备 33010602011771号