Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:
其他好文 时间:
2014-11-19 20:18:28
阅读次数:
143
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ...
分类:
其他好文 时间:
2014-11-19 20:16:39
阅读次数:
190
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...
分类:
其他好文 时间:
2014-11-19 20:16:31
阅读次数:
152
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-11-19 18:31:49
阅读次数:
137
= =买了书才能做的题。。。就是按说明来搞就行了,没啥算法。。。注意要把以前的left,right设置为nullptr,不然就是有环了,代码中加黑部分。/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:
其他好文 时间:
2014-11-19 18:19:19
阅读次数:
168
int 整数 bigint 大整数 bit 字节(电脑存储大小,点是1V一字节,一个字节代表8V。 ) char 字符 date 日期 datatime 日期+时间 decimal(18,0) 小数(小数点后18位,可以修改) image 图像money 钱类型 bigint 长整型 binary(...
分类:
其他好文 时间:
2014-11-19 17:51:44
阅读次数:
153
二叉查找树的实现二叉查找树(binary search tree, BST)的特征:1、所有节点存储一个关键字;2、非叶子节点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树(查找二叉树的中序遍历是有序序列);3、实际使用的二叉查找树一般都加入了平衡算法(balancedbinary s...
分类:
其他好文 时间:
2014-11-19 15:46:20
阅读次数:
346
Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:
其他好文 时间:
2014-11-19 15:28:41
阅读次数:
295
题目https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/对每个节点递归。 1 /** 2 * Definition for binary tree with next pointer. 3 * .....
分类:
其他好文 时间:
2014-11-19 12:13:56
阅读次数:
154
Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.Show TagsHave yo...
分类:
其他好文 时间:
2014-11-19 08:35:19
阅读次数:
207