leetcode538专题

代码随想录——把二叉搜索树转换为累加树(Leetcode538)

题目链接 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val = val; }* TreeNo

LeetCode538. Convert BST to Greater Tree

文章目录 一、题目二、题解 一、题目 Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys