摘要: https://leetcode.cn/problems/combination-sum/description/ 两种搜索思路 一种是选或不选,搜索树是一颗二叉树另一种是选哪个数,是一个n叉树 二叉 class Solution { List<List<Integer>> res = new Ar 阅读全文
posted @ 2024-05-15 22:40 风乐 阅读(7) 评论(0) 推荐(0)
摘要: https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/description/ 要点是分割左右区间,并且分割时需要注意left和right相加可能会超过int,但是本题不需要 class Solution { 阅读全文
posted @ 2024-05-15 16:51 风乐 阅读(12) 评论(0) 推荐(0)