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
在使用grep 搜索到字符串时,输出信息如下: Matched?to?a?binary?file:log 从打印消息上看,这个文本文件被当作二进制文件。 为什么? 用vim?打开log?发现原因,log文件有个^@字符,这其实就是c语言字符串...
分类:
其他好文 时间:
2014-07-22 08:19:36
阅读次数:
188
![这些选项有什么用?][1] **PK** Belongs to primary key 作为主键 **NN** Not Null 非空 **UQ** Unique index 不能重复 **BIN** Is binary column 存放二进制数据的列 **UN** Unsigned data type 无符号数据类型...
分类:
数据库 时间:
2014-07-21 10:38:22
阅读次数:
244
zabbix 更换 TokuDB 过程(我用的是percona db): wget?http://www.percona.com/redir/downloads/Percona-Server-5.6/LATEST/binary/redhat/6/x86_64/Percona-Server-tokudb-56-5.6.19-rel67.0.el6.x86_64.rpm?...
分类:
数据库 时间:
2014-07-21 10:23:35
阅读次数:
443
一,Xcode编译出现Link错误,出现"duplicate symbols for architecture i386 clang"提示. 问题:链接时,项目有重名文件. 解决: 根据错误提示,做如下检查: 1.Taraget->Build Settings->Link Binary With Libraries检查...
分类:
其他好文 时间:
2014-07-21 10:05:48
阅读次数:
191
给定一棵二叉树, 如何确定这棵二叉树的高度(即树的最大的深度), 是一个很常见的问题。
给下图回顾一下:
关于高度和深度的概念, 参见上图。
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
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; ...
分类:
其他好文 时间:
2014-07-21 00:11:12
阅读次数:
254
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; ...
分类:
其他好文 时间:
2014-07-20 22:05:06
阅读次数:
181
今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的,因为c++版的代码网上比较多,所以就只分享一下Python的代码吧,刚学完Python的基本语法,做做LeetCode的题目还是不错的,对以后找工作面试也有帮助!
刚开始就从AC率最高的入手吧!
1.Given an array of integers, every element appe...
分类:
编程语言 时间:
2014-07-20 15:27:41
阅读次数:
262