解题思路:中序遍历,左子树-根节点-右子树JAVA实现如下: public List inorderTraversal(TreeNode root) { List list = new ArrayList(); if(root==null) r...
分类:
编程语言 时间:
2015-05-20 23:56:04
阅读次数:
174
Tree Traversals AgainAn inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node ...
分类:
其他好文 时间:
2015-05-20 21:51:18
阅读次数:
110
Given a BST, find 2 nodes in it which sum to a given targethint:Inorder traversal + BST + 2 SUM* Time : O(N)* Space: O(lgN) 1 class TreeNode0 { 2 ...
分类:
其他好文 时间:
2015-05-20 13:03:34
阅读次数:
188
命名规则交叉编译工具链的命名规则为:arch [-vendor] [-os] [-(gnu)eabi]arch – 体系架构,如ARM,MIPSvendor – 工具链提供商os – 目标操作系统eabi – 嵌入式应用二进制接口(Embedded Application Binary Interf...
分类:
其他好文 时间:
2015-05-20 12:47:23
阅读次数:
106
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...
分类:
编程语言 时间:
2015-05-20 01:57:32
阅读次数:
192
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb...
分类:
编程语言 时间:
2015-05-20 01:56:53
阅读次数:
188
题目:
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 and the nodes have the same value.
C代码...
分类:
其他好文 时间:
2015-05-19 22:47:09
阅读次数:
147
首先我想说的是,osg是有二进制安装包的:http://openscenegraph.alphapixel.com/osg/downloads/free-openscenegraph-binary-downloads(也不叫二进制安装包,就是别人预先编译好的)。我认为,如果只是简单的用下osg,.....
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.解题思路:求01矩阵中,全是1的子矩阵的最大面积。把矩阵按照每一行...
分类:
编程语言 时间:
2015-05-19 20:39:59
阅读次数:
280
题目:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total num...
分类:
编程语言 时间:
2015-05-19 12:08:38
阅读次数:
230