题目
Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
方法
根据树的中序遍历和前序遍历,来构造树,使用递归的思想。
Tre...
分类:
其他好文 时间:
2014-06-20 12:14:49
阅读次数:
262
查询已经创建的数据库 show dbs
选择数据库
use DATABASE_NAME
查询该数据库里面的集合 show collections
删除集合操作:
db.COLLECTION_NAME.drop()
插入数据操作:
db.COLLECTION_NAME.insert(
do...
分类:
数据库 时间:
2014-06-20 10:57:41
阅读次数:
275
以下3步问正确的程序片段:
1.写文件
#! /usr/bin/python3
'makeTextFile.py -- create text file'
import os
def write_file():
"used to write a text file."
ls = os.linesep
#get filena...
分类:
编程语言 时间:
2014-06-20 10:47:27
阅读次数:
278
17.4、Making User-Managed Backups of Online Tablespaces and Datafiles
当数据库打开时,可以备份一个在线表空间所有和一个指定的数据文件。备份过程的区别依赖于在线表空间是read、write或者read-only。
注意:不应该备份临时表空间
17.4.1、Making User-Managed Backups of Onlin...
分类:
其他好文 时间:
2014-06-20 10:04:43
阅读次数:
289
等等通过实例自己实践之后的清晰了很多,多动手多动手,TO Do TO DO !...
分类:
编程语言 时间:
2014-06-20 09:43:55
阅读次数:
306
1.DOM和SAX的区别:
1)dom把所有的xml文档信息都存于内存中
sax无需一次把xml文件加载到内存中,采用的是事件驱动的操作
2)dom应用场景:对于大文件来说几乎不可能使用
dom可以直接获取某个节点的操作Document.get,而sax不可以
2.DOM和SAX的优缺点:
DOM的优势主要表现在:易用性强,使用DO...
分类:
其他好文 时间:
2014-06-20 09:26:24
阅读次数:
300
题目
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary t...
分类:
其他好文 时间:
2014-06-07 15:31:32
阅读次数:
179
【题目】
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ ...
分类:
其他好文 时间:
2014-06-07 13:57:37
阅读次数:
210
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.Thirty days has September,
April, June and November.
All the rest have thirty...
分类:
其他好文 时间:
2014-06-07 13:56:52
阅读次数:
166
并查集,
删除节点操作,可以用新建节点代替
维护每个点到跟节点的距离
Gears
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob has N (1 ≤ N ≤ 2*105) gears (numbered from 1 to N). Each gear can rotate clockwise or co...
分类:
其他好文 时间:
2014-06-07 11:33:37
阅读次数:
227