![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二叉树
h_wzy
这个作者很懒,什么都没留下…
展开
-
验证二叉搜索树
由于二叉搜索树的中序遍历是一个递增序列,我们只需要把这个中序遍历保存下来,再判断这是一个递增序列即可: class Solution { public: /** * @param root: The root of binary tree. * @return: True if the binary tree is BST, or false * */ void inorderTraversal(...原创 2019-03-05 10:11:42 · 79 阅读 · 0 评论 -
二叉树的序列化与反序列化
class Solution { public: /** * This method will be invoked first, you should design your own algorithm * to serialize a binary tree which denote by a root node to a string which * can be easily deseri...原创 2019-03-05 16:26:24 · 205 阅读 · 0 评论