Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.
自己想的复杂了,其实就是一个反向的inorder。新的值就是前面所有元素的求和。
2022-12-04 22:03:57
Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.
自己想的复杂了,其实就是一个反向的inorder。新的值就是前面所有元素的求和。