摘要:
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 n... 阅读全文
posted @ 2015-07-03 13:23
又岸
阅读(323)
评论(0)
推荐(0)
摘要:
和之前的层次遍历是一样的,只不过要在最后处理数组的时候,下一个层次利用reverse反转就好 1 class Solution { 2 public: 3 vector > zigzagLevelOrder(TreeNode* root) { 4 vector > v; 5 ... 阅读全文
posted @ 2015-07-03 09:27
又岸
阅读(206)
评论(0)
推荐(0)
摘要:
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2... 阅读全文
posted @ 2015-07-03 06:21
又岸
阅读(178)
评论(0)
推荐(0)
浙公网安备 33010602011771号