![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tree
--asx
这个作者很懒,什么都没留下…
展开
-
LC 102 Binary Tree Level Order Traversal
基础中的基础,直接背就好了。用队列。因为需要在最后按层序打印,所以队列中记录层数。AC代码/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(...原创 2018-03-12 13:16:22 · 176 阅读 · 0 评论 -
LC 98. Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.The right ...原创 2018-03-12 14:19:46 · 115 阅读 · 0 评论