Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up...
分类:
其他好文 时间:
2015-01-19 09:07:58
阅读次数:
134
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 / \ ...
分类:
其他好文 时间:
2015-01-19 00:09:50
阅读次数:
174
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...
分类:
其他好文 时间:
2015-01-19 00:06:07
阅读次数:
241
二叉查找树(Binary Search Tree),也称二叉搜索树、有序二叉树(ordered binary tree),排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:...
分类:
其他好文 时间:
2015-01-18 22:45:47
阅读次数:
336
(http://leetcode.com/2010/11/convert-sorted-list-to-balanced-binary.html)Given a singly linked list where elements are sorted in ascending order, conv...
分类:
其他好文 时间:
2015-01-18 22:18:49
阅读次数:
202
(1)二叉树的概念二叉树(Binary Tree)是个有限元素的集合,该集合或者为空、或者由一个称为根(root)的元素及两个不相交的、被分别称为左子树和右子树的二叉树组成。当集合为空时,称该二叉树为空二叉树。满二叉树:在一棵二叉树中,如果所有分支结点都存在左子树和右子树,并且所有叶子结点都在同一层...
分类:
其他好文 时间:
2015-01-18 21:04:20
阅读次数:
188
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.思路:题目看上去好像很难,但实际上很简单,递归做就行,每次找到左右子树对应的子链表...
分类:
其他好文 时间:
2015-01-18 21:03:17
阅读次数:
241
前面介绍了二叉查找树(Binary Search Tree),他对于大多数情况下的查找和插入在效率上来说是没有问题的,但是他在最差的情况下效率比较低。本文及后面文章介绍的平衡查找树的数据结构能够保证在最差的情况下也能达到lgN的效率,要实现这一目标我们需要保证树在插入完成之后始终保持平衡状态,这就是...
分类:
编程语言 时间:
2015-01-18 18:26:43
阅读次数:
256
基于HEP(histograms of equivalent patterns【1】)框架下的特征具有良好的纹理分类效果,LBP(local binary patterns【2】)属于HEP框架下最常用的特征,具有对亮度、旋转等良好的不变特性。在基于分块的视频烟雾检测中,常使用其作为纹理分类的特征。...
分类:
其他好文 时间:
2015-01-18 18:22:38
阅读次数:
409
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:
其他好文 时间:
2015-01-18 18:21:13
阅读次数:
151