Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre...
分类:
其他好文 时间:
2014-07-31 23:11:40
阅读次数:
225
1 ?引言? ? ??Grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并?把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。G...
分类:
系统相关 时间:
2014-07-31 17:26:59
阅读次数:
466
正则表达式与python的网页操作练习一:importurllib.request
importre
qname=input(‘inputenglish:‘)
qname=qname.strip()
url=‘http://dict.youdao.com/search?le=eng&q=‘+qname+‘&keyfrom=dict.top‘
html=urllib.request.urlopen(url)
source=html.read().decode(‘U..
分类:
编程语言 时间:
2014-07-31 17:21:47
阅读次数:
242
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:
其他好文 时间:
2014-07-31 16:08:26
阅读次数:
283
题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ....
分类:
编程语言 时间:
2014-07-31 05:21:55
阅读次数:
215
https://forum.videolan.org/search.php?keywords=live555&terms=all&author=&fid%5B%5D=13&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&sid=b519e9e29dc5c...
分类:
其他好文 时间:
2014-07-30 20:38:24
阅读次数:
169
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight...
分类:
其他好文 时间:
2014-07-30 17:46:04
阅读次数:
244
js中处理正则表达式的类:RegExp用法: var reg=new RegExp("express");或者: var reg=/express/;js中常用的6个方法: test():是否存在 exec():返回查询值 match():得到查询的数组 search():返回搜索的位置 rep.....
分类:
编程语言 时间:
2014-07-30 17:13:13
阅读次数:
282
git上的项目基本都可以用cocoapods导入 特别方便。使用方法:更新cocoapods :$ sudo gem update cocoapods查询第三方库是否存在:$ pod search xxx导入第三方库:进入项目的根目录,并在根目录下创建一个名叫Podfile的文件(没有任何后缀):$...
分类:
其他好文 时间:
2014-07-30 11:37:43
阅读次数:
199
DFS(Depth First Search) 深度优先搜索BFS (Breadth First Search)宽度优先搜索在算法中常用这两种方法。1) DFS考虑用“递归”实现和用 “栈”实现两种方法,因为对于大型问题搜索深度比较深,如果用递归实现的话,栈空间占用比较多,递归调用需要的额外时间也比...
分类:
其他好文 时间:
2014-07-30 09:54:03
阅读次数:
234