// 继续遍历左右节点 // 这里new path是因为左右都会在下次递归path.add(root.val); this.find(root.left, target, result, new ArrayList<>(path)); this.find(root.right, target, result, new ArrayList<>(path)); 请问这里在传递path的时候,为什么要new一下呢
点赞

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务