List the directories in a tree-like format
分类:
其他好文 时间:
2014-07-22 22:49:13
阅读次数:
215
Problem Description判断两序列是否为同一二叉搜索树序列Input开始一个数n,(1#include#define max 512;int main(){ int i,j,n,c; int tree[512],tree1[512]; char s[22]; ...
分类:
其他好文 时间:
2014-07-22 22:48:54
阅读次数:
181
What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extra space.For example,Given ...
分类:
其他好文 时间:
2014-07-22 08:37:34
阅读次数:
289
$dom?=?new?DOMDocument?(?‘1.0‘,?‘gbk‘?);
????$dom->formatOutput?=?true;
????$comment_str?=?‘?file?create?time:?‘?.?date(‘Y-m-d?H:i:s‘,?time())??.?‘?by?tree....
分类:
Web程序 时间:
2014-07-22 08:34:33
阅读次数:
237
\* _你也可以去[Github](https://github.com/android-cn/android-open-project-analysis/tree/master/dagger)查看这片文章_ #### 简介 在开发程序的时候,会用到各种对象,很多对象在使用之前都需要进行初始化。例...
分类:
移动开发 时间:
2014-07-21 10:36:12
阅读次数:
309
有时候系统菜单用tree布局会显得单调内容少,这适合可以考虑DataView布局 Ext.define(‘MyApp.view.ReportRecord.window.ReportRecordWin‘,?{
extend?:?"Ext.window.Window",
alias?:?‘widget.reportrecor...
分类:
Web程序 时间:
2014-07-21 10:11:57
阅读次数:
318
对于一个二叉搜索树, 要想找到这棵树的最小元素值, 我们只需要从树根开始, 沿着left 孩子指针一直走, 知道遇到NULL(即走到了叶子), 那么这个叶子节点就存储了这棵二叉搜索树的最小元素。 同理, 从根节点开始, 沿着right 孩子指针, 最终找到的是最大关键字的节点。
也就是说寻找BST最小关键字的元素和最大关键字的元素的代码是对称的。伪代码如下:
TREE_MINIMUM(x...
分类:
编程语言 时间:
2014-07-21 09:28:27
阅读次数:
241
给定一棵二叉树, 如何确定这棵二叉树的高度(即树的最大的深度), 是一个很常见的问题。
给下图回顾一下:
关于高度和深度的概念, 参见上图。
NOTE: 高度: 参考节点是距离节点最远的叶子
深度: 参考节点是根节点
寻找二叉树的高度也可以通过一个递归函数(a recursive function)实现, 这依然源于树是一个递归的数据结构。
例如, 对于下图, 我们可以求出根...
分类:
编程语言 时间:
2014-07-21 09:18:35
阅读次数:
344
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-07-21 09:07:24
阅读次数:
207
今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的,因为c++版的代码网上比较多,所以就只分享一下Python的代码吧,刚学完Python的基本语法,做做LeetCode的题目还是不错的,对以后找工作面试也有帮助!
刚开始就从AC率最高的入手吧!
1.Given an array of integers, every element appe...
分类:
编程语言 时间:
2014-07-20 15:27:41
阅读次数:
262