Two pointer, 一头一尾;brute force的话需要时间复杂度为O(n^2);但是two pointer的方法可以进行简化(通过对某些case的省略): 具体: height[low] = height[high]: 则知道 height[high]与任意height[low...
分类:
其他好文 时间:
2014-12-30 09:11:34
阅读次数:
153
51CTO上无闻老师的教学视频视频中的课堂笔记地址:https://github.com/Unknwon/go-fundamental-programming另,提供一下从网上下载下来的一份资料。
分类:
其他好文 时间:
2014-12-30 01:56:00
阅读次数:
176
/// /// 执行SQL语句,返回影响的记录数 /// /// SQL语句 /// 影响的记录数 public static int ExecuteSql(string SQLString, params OleDbPara...
分类:
数据库 时间:
2014-12-30 00:21:53
阅读次数:
173
这个题目与java里的BigInteger实现有些类似,可以参考其源码。
题目:
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is a...
分类:
其他好文 时间:
2014-12-29 21:24:42
阅读次数:
190
原题:
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalanci...
分类:
其他好文 时间:
2014-12-29 18:24:07
阅读次数:
154
Description: In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several cons...
分类:
其他好文 时间:
2014-12-28 22:01:51
阅读次数:
212
Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:
其他好文 时间:
2014-12-28 18:12:08
阅读次数:
170
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:
其他好文 时间:
2014-12-28 16:53:21
阅读次数:
198
Description Nchildren are sitting in a circle to play a game. The children are numbered from 1 toNin clockwise order. Each of them has a card with a.....
分类:
其他好文 时间:
2014-12-28 15:33:01
阅读次数:
291
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 transaction (ie, buy one and sell one share of the stock),...
分类:
其他好文 时间:
2014-12-26 16:41:15
阅读次数:
136