04 2024 档案
摘要:优先级队列中存了我自定义的对象,比较规则写好了,存完了之后我去修改堆中对象的值(比较器中写的值),发现堆没有即刻相应调整,导致结果不对 但是每次我让堆中出一个,再进一个堆就调整好了 暂时不知道什么原因,猜测可能是堆中存对象的话需要改动才会调整。我猜不可能维护一个后台线程一直去调整它 答复: 通过简单
阅读全文
摘要:解决: 原因:node版本高于16,项目的版本不高于16。 解决方法: 在命令行修改环境变量:$env:NODE_OPTIONS="--openssl-legacy-provider" 然后 npm run serve
阅读全文
摘要:797. 所有可能的路径 https://leetcode.cn/problems/all-paths-from-source-to-target/description/ List<List<Integer>> res; List<Integer> path; public List<List<I
阅读全文
摘要:77. 组合 https://leetcode.cn/problems/combinations/description/ List<List<Integer>> res = new ArrayList<>(); List<Integer> path = new ArrayList<>(); pub
阅读全文
摘要:530. 二叉搜索树的最小绝对差 https://leetcode.cn/problems/minimum-absolute-difference-in-bst/description/ TreeNode pre = null; int res = Integer.MAX_VALUE; public
阅读全文