码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcode:Binary Tree Postorder Traversal
class Solution { public: vector postorderTraversal(TreeNode *root) { vector res; stack>s; TreeNode *p = root; while(p!=NULL||!s.empty()) { while...
分类:其他好文   时间:2015-04-02 19:02:48    阅读次数:117
leetcode:Binary Tree Preorder Traversal
class Solution { public: vector preorderTraversal(TreeNode *root) { vector res; stack s; TreeNode * p = root; while(p!=NULL||!s.empty()) { while...
分类:其他好文   时间:2015-04-02 19:02:38    阅读次数:131
leetcode:Binary Tree Inorder Traversal
class Solution { public: vector inorderTraversal(TreeNode *root) { vector res; stack s; TreeNode * p = root; while(p!=NULL||!s.empty()) { while(...
分类:其他好文   时间:2015-04-02 19:01:33    阅读次数:98
MySQL 同步状态
Exec_Master_Log_Pos: The position of the last event executed by the SQL thread from the master's binary log (Relay_Master_Log_File). (Relay_Master_L.....
分类:数据库   时间:2015-04-02 18:31:50    阅读次数:134
【leetcode】Path Sum2
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:其他好文   时间:2015-04-02 15:01:01    阅读次数:112
【leetcode】Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2015-04-02 14:48:37    阅读次数:163
leetCode 98-Validate Binary Search Tree
题目链接:https://leetcode.com/problems/validate-binary-search-tree/ 就是判断一个给定的二叉树是否为二叉查找树。 我的思路是:先将该树中序遍历一遍,按中序遍历的顺序保存到一个vector中,然后判断vector中的顺序即可。 代码: class Solution { public: void inOrder(TreeNode...
分类:其他好文   时间:2015-04-02 10:29:28    阅读次数:107
leetcode_num98_Validate Binary Search Tree
判断是否为二叉搜索树 定义上下确界 /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} *...
分类:其他好文   时间:2015-04-01 23:51:43    阅读次数:130
【CF492E】【数学】Vanya and Field
Vanya decided to walk in the field of size n?×?n cells. The field contains m apple trees, the i-th apple tree is at the cell with coordinates (xi,?yi)...
分类:其他好文   时间:2015-04-01 23:19:33    阅读次数:113
Leetcode: Binary Tree Preorder Traversal(二叉树非递归前序遍历)
题目: Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3},1    \     2    / 3return [1,2,3].Note: Recursive solution is triv...
分类:其他好文   时间:2015-04-01 21:56:42    阅读次数:96
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!