码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
【leetcode】501. Find Mode in Binary Search Tree
class Solution { public: vector modes; int maxCnt = 0; int curCnt = 0; int curNum = 0; vector findMode(TreeNode* root) { if (!root) { return modes; } ... ...
分类:其他好文   时间:2019-02-15 17:20:32    阅读次数:146
树的遍历 | 翻转二叉树
Invert a binary tree. 思路1 递归: 把左子树和右子树进行交换。交换完之后,再去递归翻转左子树和右子树 思路2 遍历 换父节点的时候,把子节点存下来,然后换完父节点了,就去换子点的。 ...
分类:其他好文   时间:2019-02-14 23:58:41    阅读次数:324
[Lintcode]7. Serialize and Deserialize Binary Tree/[Leetcode]297. Serialize and Deserialize Binary Tree
"7. Serialize and Deserialize Binary Tree" / "297. Serialize and Deserialize Binary Tree" 本题难度: Medium/Hard Topic: Binary Tree Description Design an a ...
分类:其他好文   时间:2019-02-14 23:57:27    阅读次数:302
[Leetcode]700. Search in a Binary Search Tree
"700. Search in a Binary Search Tree" 本题难度: Easy Topic: Binary Tree Description Given the root node of a binary search tree (BST) and a value. You nee ...
分类:其他好文   时间:2019-02-14 22:29:28    阅读次数:164
树的遍历 | 相同的树
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident ...
分类:其他好文   时间:2019-02-14 22:19:34    阅读次数:204
[Lintcode]95. Validate Binary Search Tree/[Leetcode]98. Validate Binary Search Tree
"95. Validate Binary Search Tree" / "98. Validate Binary Search Tree" 本题难度: Easy Topic: Binary Tree Description Given a binary tree, determine if it i ...
分类:其他好文   时间:2019-02-14 22:12:44    阅读次数:199
[Lintcode]97. Maximum Depth of Binary Tree/[Leetcode]104. Maximum Depth of Binary Tree
"97. Maximum Depth of Binary Tree" / "104. Maximum Depth of Binary Tree" 本题难度: Easy Topic: Binary Tree Description Given a binary tree, find its maxim ...
分类:其他好文   时间:2019-02-14 20:52:17    阅读次数:169
[Lintcode]93. Balanced Binary Tree/[Leetcode]
"93. Balanced Binary Tree" / "" 本题难度: Easy Topic: Binary Tree Description Given a binary tree, determine if it is height balanced. For this problem, a ...
分类:其他好文   时间:2019-02-14 20:37:15    阅读次数:145
Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n ...
分类:其他好文   时间:2019-02-14 15:05:23    阅读次数:168
UOJ 407(IOI2018 D1T3)
给定一张$n$个点,$m$条边的无向连通图以及$q$次询问,每次询问给出$S,E,L,R$,问你是否能从$S$出发,不经过编号小于$L$的点到达某个编号大于等于$L$且小于等于$R$的点,此时切换状态,不经过编号大于$R$的点到达$E$。 $$n\le200000,m\le400000,q\le20 ...
分类:其他好文   时间:2019-02-13 22:49:07    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!