二叉查找树
文章平均质量分 72
liumanmanll
其实是个不怎么登录的摆烂
展开
-
在二叉查找树中插入节点
问题描述: 给定一棵二叉查找树和一个新的树节点,将节点插入到树中。 你需要保证该树仍然是一棵二叉查找树。 注意事项 You can assume there is no duplicate values in this tree + node. 样例 给出如下一棵二叉查找树,在插入节点6之后这棵二叉查找树可以是这样的: 2原创 2017-05-15 21:03:21 · 416 阅读 · 0 评论 -
Convert BST to Greater Tree
问题描述: Given 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 sum of all keys greater than the original key in BST原创 2017-05-16 15:18:29 · 194 阅读 · 0 评论 -
二叉查找树做题总结
做二叉查找树时首先要知道二叉查找树的特点,插入节点时要先判断插入节点的位置,即对节点的数值和根节点的数值做出比较,大于根节点的数值时插入位置在右子树,小于根节点的数值时,插入位置在左子树。对二叉查找树进行操作后,最后返回的树依然是二叉查找树。原创 2017-05-18 17:13:54 · 277 阅读 · 0 评论