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 ...
分类:
其他好文 时间:
2014-05-17 11:30:21
阅读次数:
247
Herve Leger dresses ccommodate gas and electric
light. To be honest with you, it is limited to children and the elderly. You
will be pleased with all ...
分类:
其他好文 时间:
2014-05-17 00:38:15
阅读次数:
406
一次过 1 public class Solution { 2 public String
countAndSay(int n) { 3 if (n <= 0) return ""; 4 int i = 1; 5 String current
...
分类:
其他好文 时间:
2014-05-16 21:27:59
阅读次数:
267
上一节实现了对TableExpression的解析,通过反射创建实例以及构建该实例的成员访问表达式生成了一个TableExpression,并将其遍历格式化为”Select
* From TableName ”之类的SQL语句,本节继续对其他QueryExpression进行解析。先回顾一下几个类的...
分类:
其他好文 时间:
2014-05-16 08:26:20
阅读次数:
361
Asp.Net MVC 模型(使用Entity Framework创建模型类) -
Part.1这篇教程的目的是解释在创建ASP.NET MVC应用程序时,如何使用Microsoft Entity
Framework来创建数据访问类。这篇教程假设你事先对Microsoft Entity Framew...
分类:
Web程序 时间:
2014-05-16 05:26:23
阅读次数:
474
Given two integersnandk, return all possible
combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution
is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-05-14 03:54:40
阅读次数:
250
Bob enjoys playing computer games, especially
strategic games, but sometimes he cannot find the solution fast enough and then
he is very sad. Now he h...
分类:
其他好文 时间:
2014-05-14 00:29:42
阅读次数:
251
前言
不管这篇写到哪里,就以这篇作为结尾,结束这个流水回顾系列文了。
Computer History Museum
计算机历史博物馆(网站)是在Google旁边,参观Google之前的行程。
记得那是一个阳光明媚的日子,在前往硅谷朝圣的路上,内心还是有点小激动的。
临走前我买了顶帽子作纪念,也刚好用来抵御湾区的大太阳。
Google
大家在计算机历史博物馆外...
分类:
其他好文 时间:
2014-05-13 16:00:22
阅读次数:
230
二进制相加,本质上就是大整数加法,有关大整数加法我的舍友教过我一个很好的方法,先用一个int数组保存结果,将两个数对应位置相加,全部加完后,再统一处理进位的问题。这个方法同样适用于大整数的乘法。
这个题没什么特别的,注意一下进位别搞错了就行了,还有其实不用像我写的这么麻烦,可以一开始先判断哪个更长一些,交换一下。代码会简洁很多。class Solution {
public:
strin...
分类:
其他好文 时间:
2014-05-13 08:02:00
阅读次数:
239
Person's solution 是用来一种基于软件的解决关键区域问题的算法(critical-section).
它并非完美的,有可能不正确地工作。而且是限制解决两个进程同步的问题。
但是它很简单,很原始,学习起来也是很轻松的。
代码如下:
do {
flag[i] = true;
turn = j;
while (flag[j] && turn == j...
分类:
编程语言 时间:
2014-05-13 08:01:01
阅读次数:
407