摘要: dp 解法(类似 bfs, 有些像杨辉三角) dfs 解法(递归回溯+剪枝) 阅读全文
posted @ 2019-09-01 22:17 lasclocker 阅读(724) 评论(0) 推荐(0) 编辑
摘要: dp 时间复杂度O(N), 空间复杂度O(N) dp 优化 时间复杂度O(N), 空间复杂度O(1) 阅读全文
posted @ 2019-09-01 18:15 lasclocker 阅读(175) 评论(0) 推荐(0) 编辑
摘要: dp 时间复杂度O(N^2) dp + 二分查找 时间复杂度O(N lg(N)) public int lengthOfLIS(int[] nums) { int[] smallestTails = new int[nums.length]; int realSize = 0; for (int i 阅读全文
posted @ 2019-09-01 16:42 lasclocker 阅读(147) 评论(0) 推荐(0) 编辑
摘要: dp 解法 时间复杂度 O(N^2) public int findNumberOfLIS(int[] nums) { int[] length = new int[nums.length]; int[] count = new int[nums.length]; for (int i = 0; i 阅读全文
posted @ 2019-09-01 12:48 lasclocker 阅读(458) 评论(0) 推荐(0) 编辑