题目:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3...
分类:
编程语言 时间:
2014-07-30 09:54:33
阅读次数:
195
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,...
分类:
编程语言 时间:
2014-07-30 09:49:43
阅读次数:
177
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:
编程语言 时间:
2014-07-30 05:35:13
阅读次数:
260
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:
编程语言 时间:
2014-07-30 05:35:03
阅读次数:
309
题目:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transact....
分类:
编程语言 时间:
2014-07-30 05:34:13
阅读次数:
248
对文件和文件夹都有效FileSetAttr('D:\Administrator\Desktop\patcher\Win32\Release\config\element\update',faHidden);声明:function FileSetAttr ( const FileName : stri...
分类:
其他好文 时间:
2014-07-29 20:43:52
阅读次数:
234
#!/bin/bash
#
#Judgingtheelementisafileorafolder
if[$#-lt1];then
echo"ERROE!!Usage:ckfile.shARGS1[ARGS2...]"
exit4
fi
foriin`seq1$#`
do
if[-f$1];then
echo$1isacommomfile
elif[-d$1];then
echo$1isadirectory
else
echo"$1isnotexsitorunknown!"
fi
shift
done知识..
分类:
其他好文 时间:
2014-07-29 16:01:19
阅读次数:
184
[LeetCode]Binary Tree Level Order Traversal II...
分类:
其他好文 时间:
2014-07-29 14:42:48
阅读次数:
145
Gem StonesJohn has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lowercase latin letter fr...
分类:
其他好文 时间:
2014-07-29 13:38:28
阅读次数:
208
所谓遍历(Traversal)是指沿着某条搜索路线,依次对树中每个结点均做一次且仅做一次访问,对二叉树的遍历就是将非线性结构的二叉树中的节点排列在一个线性序列上的过程。访问结点所做的操作依赖于具体的应用问题。 遍历是二叉树上最重要的运算之一,是二叉树上进行其它运算之基础。 如果采用顺序结构来保存二叉树,遍历二叉树非常容易,直接遍历底层数组即可。如果采用链表来保存,则有以下两类遍历方式:...
分类:
编程语言 时间:
2014-07-29 12:54:47
阅读次数:
241