摘要: 目录 加油站 分发糖果 柠檬水找零 根据身高重建队列 一、加油站 https://leetcode.cn/problems/gas-station/description/?envType=problem-list-v2&envId=8At1GmaZ class Solution { public 阅读全文
posted @ 2025-05-25 21:27 筱倩 阅读(16) 评论(0) 推荐(0)
摘要: 目录 买卖股票的最佳时机 跳跃游戏 跳跃游戏II K次取反后最大化的数组和 一、买卖股票的最佳时机 https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/?envType=problem-list-v2&envId=8At1G 阅读全文
posted @ 2025-05-24 23:49 筱倩 阅读(10) 评论(0) 推荐(0)
摘要: 目录 分发饼干 摆动序列 最大子序和 二、分发饼干 https://leetcode.cn/problems/assign-cookies/?envType=problem-list-v2&envId=8At1GmaZ class Solution { public int findContentC 阅读全文
posted @ 2025-05-22 16:06 筱倩 阅读(12) 评论(0) 推荐(0)
摘要: 目录 递增子序列 全排列 全排列II 重新安排行程 N皇后 解数独 一、递增子序列 https://leetcode.cn/problems/non-decreasing-subsequences/description/?envType=problem-list-v2&envId=8At1GmaZ 阅读全文
posted @ 2025-05-22 14:36 筱倩 阅读(10) 评论(0) 推荐(0)
摘要: 目录 复原IP地址 子集 子集II 一、复原IP地址——分割题 https://leetcode.cn/problems/restore-ip-addresses/description/?envType=problem-list-v2&envId=8At1GmaZ class Solution { 阅读全文
posted @ 2025-05-21 16:00 筱倩 阅读(9) 评论(0) 推荐(0)
摘要: 目录 组合总和 组合总和II 分割回文串 ⭐⭐⭐ 一、组合总和 https://leetcode.cn/problems/combination-sum/description/?envType=problem-list-v2&envId=8At1GmaZ class Solution { List 阅读全文
posted @ 2025-05-20 22:43 筱倩 阅读(18) 评论(0) 推荐(0)
摘要: 目录 理论基础 组合 组合总和III 电话号码的字母组合 一、理论基础 回溯法,一般可以解决以下问题: 组合问题:N个数里面按一定规则找出k个数的集合 切割问题:一个字符按一定规则有几种切割方式 子集问题:一个N个数的集合里面有多少符合条件的子集 排列问题:N个数按照一定规则全排列,有几种排列方式 阅读全文
posted @ 2025-05-17 21:03 筱倩 阅读(273) 评论(0) 推荐(0)
摘要: 目录 修剪二叉搜索树 将有序数组转换为二叉搜索树 把二叉搜索树转换为累加树 一、修建二叉搜索树 https://leetcode.cn/problems/trim-a-binary-search-tree/?envType=problem-list-v2&envId=8At1GmaZ class S 阅读全文
posted @ 2025-05-16 23:29 筱倩 阅读(13) 评论(0) 推荐(0)
摘要: 目录 二叉搜索树的最近公共祖先 二叉搜索树中的插入操作 删除二叉搜索树中的节点 一、二叉搜索树的最近公共祖先 https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-search-tree/description/?envTyp 阅读全文
posted @ 2025-05-16 22:40 筱倩 阅读(240) 评论(0) 推荐(0)
摘要: 目录 哈希表是什么,常见哈希表及其区别 哈希函数、哈希碰撞(哈希冲突解决方法:两个) hashmap底层实现(发生哈希冲突、是线程安全的吗、和concurrentHashMap的区别、和hashtable的区别、可以存null值吗、为什么、锁机制) 一、哈希表是什么 哈希表是一种基于数组+哈希函数+ 阅读全文
posted @ 2025-05-15 23:33 筱倩 阅读(353) 评论(0) 推荐(0)