??
Symmetric Tree Total Accepted:
61440 Total Submissions:
194643
My Submissions
Given a binary tree, check whether it is a mirror of itself (ie, symmetric ar...
分类:
其他好文 时间:
2015-07-10 00:29:44
阅读次数:
157
题意:如题思路:递归解决,同判断对称树的原理差不多。先保证当前两个结点是相等的,再递归保证两左结点是相等的,再递归保证右结点是相等的。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int ...
分类:
其他好文 时间:
2015-07-10 00:08:15
阅读次数:
243
二叉查找树(Binary Search Tree),也称有序二叉树(ordered binary tree),排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:1. 若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值;2. 若任意节点的右子树不...
分类:
编程语言 时间:
2015-07-10 00:07:29
阅读次数:
230
RPM是RedHatPackageManager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”rpm执行安装包二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作为后缀名。常用命令组合:..
分类:
系统相关 时间:
2015-07-09 22:49:11
阅读次数:
317
题目:
Given a complete binary tree, count the number of nodes.
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completel...
分类:
编程语言 时间:
2015-07-09 22:42:58
阅读次数:
266
Remove Node in Binary Search TreeGiven a root of Binary Search Tree with unique value for each node. Remove the node with given value. If there is no ...
分类:
其他好文 时间:
2015-07-09 22:39:36
阅读次数:
156
Count Complete Tree NodesGiven acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary...
分类:
其他好文 时间:
2015-07-09 19:33:00
阅读次数:
92
题目:
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Give...
分类:
编程语言 时间:
2015-07-09 17:59:13
阅读次数:
112
Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth
smallest element in it.
Note:
You may assume k is always valid, 1 ≤ k ≤ BST's to...
分类:
其他好文 时间:
2015-07-09 14:40:05
阅读次数:
122
解法一:非递归 1 vector preorderTraversal(TreeNode* root) 2 { 3 vector res; 4 if (root == NULL) 5 return res; 6 7 stack node_stack; 8 ...
分类:
其他好文 时间:
2015-07-09 13:09:15
阅读次数:
103