Problem Description:
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 nodes with keys l...
分类:
其他好文 时间:
2014-05-15 11:22:21
阅读次数:
317
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Unique Binary Search Trees II
Total Accepted: 7349 Total
Submissions: 27648
Given n, generate all structurally unique ...
分类:
其他好文 时间:
2014-05-15 07:02:36
阅读次数:
252
题意:输出一个元素在一个已排序的数组中的位置,如果不存在输出它应该插入的位置
思路:二分查找,如果找到就输出位置,找不到就输出它应该插入的位置
复杂度:时间O(log n),空间O(1)
相关题目:
Search for a Range
Search a 2D Matrix...
分类:
其他好文 时间:
2014-05-15 05:57:32
阅读次数:
271
最近安装好了MySQL之后,在启动MySQL服务时无法正常启动MySQL。提示没有更新/var/lib/mfailedZDB.pid并退出。该MySQL与Oracle位于同一主机。有些内核参数进行过调整应该也是使用与MySQL。下面是该问题的具体描述。1、故障现象SZDB:/usr/src/mysql_src # /etc/init.d/mysql startStarting MySQL...Th...
分类:
数据库 时间:
2014-05-15 05:41:43
阅读次数:
534
Pat1043代码
题目描述:
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:
The left subtree of a node contains only nodes with keys less than t...
分类:
其他好文 时间:
2014-05-15 05:09:59
阅读次数:
351
1.什么是re
正则表达式一门相对通用的语言,在python中也有对正则表达式的支持,那就是的内置re模块。正则表达式就是一系列的规则去匹配字符串然后进行相应的操作,这些规则网上一搜一大片,而re则是运用正则表达式来提供一系列的功能强大的接口让我们来调用。通常我们在对日志文件进行操作的时候会对正则表达式运用的比较多来得到我们希望得到的数据。
2.python中的转义符...
分类:
编程语言 时间:
2014-05-15 03:58:49
阅读次数:
465
题目
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer...
分类:
其他好文 时间:
2014-05-15 03:41:11
阅读次数:
257
innodb索引概念总结记录下innodb的索引概念,以备查看innodb索引分类:聚簇索引(clustered
index) 1) 有主键时,根据主键创建聚簇索引 2) 没有主键时,会用一个唯一且不为空的索引列做为主键,成为此表的聚簇索引 3)
如果以上两个都不满足那innodb自己创建一个...
分类:
数据库 时间:
2014-05-14 18:14:41
阅读次数:
402
写论文的Idea哪里来?
1.寻求数学上的变化。
2.测试现有的他人方法的不足之处。
3.用多种方法详尽解决一个问题。
4.用一个方法解决多种问题。
5.善用跨学科成果。
最重要的2种能力:
1.实验能力。
2.检索能力。Research俗称Re-Search
写论文的要...
分类:
其他好文 时间:
2014-05-14 15:16:14
阅读次数:
266
mysql5.6.14配置my.cnf多实例,mysql_install_db初始化不读取my.cnf配置文件
[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a differentsize 768 pages (rounded down to MB) than specified in the .cnf file: initial65536 pages, max 0 (relevant if non-zero) pages!
2014-0...
分类:
数据库 时间:
2014-05-14 14:20:48
阅读次数:
412