题目描述:The gray code is a binary numeral system
where two successive values differ in only one bit.Given a non-negative
integernrepresenting the total n...
分类:
其他好文 时间:
2014-05-26 21:30:04
阅读次数:
296
Given a strings1, we may represent it as a
binary tree by partitioning it to two non-empty substrings recursively.Below is
one possible representation...
分类:
其他好文 时间:
2014-05-26 11:24:36
阅读次数:
214
CREATE TABLE #MoneyTable ( Id INT IDENTITY(1,
1) PRIMARY KEY , MoneyName VARCHAR(50) ...
分类:
移动开发 时间:
2014-05-26 06:25:35
阅读次数:
325
Given n non-negative integers representing an
elevation map where the width of each bar is 1, compute how much water it is
able to trap after raining....
分类:
移动开发 时间:
2014-05-23 03:59:43
阅读次数:
364
getActiveWorkbenchWindow 有如下声明
/**
* Returns the currently active window for this workbench (if any). Returns
* null if there is no active workbench window. Returns
* null if called from a non-...
对于单纯常量,最好以const对象或enums替换#defines对于形似函数的宏,最好改用inline函数替换#define将某些东西声明为const可帮助编译器侦测出错误用法。const可被施加于任何作用域内的对象、函数参数、函数返回类型、成员函数本体。当const和non-const成员函数有着实质等价的实现时,令non-const版本调用const版本可避免代码重复。确定对象被使用前已经被...
分类:
编程语言 时间:
2014-05-22 17:09:29
阅读次数:
263
【题目】
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Your goal is to reach the last index in the minimum number of ju...
分类:
其他好文 时间:
2014-05-22 17:02:20
阅读次数:
244
在编写Python程序时,程序中有中文时经常会出现错误信息:SyntaxError: Non-ASCII character '\xe5'
出现这种情况,可以用如下解决办法:
python的默认编码文件是用的ASCII码,你将文件存成了UTF-8,解决办法很简单,在文件开头加入如下代码:
#coding=utf-8
这就可以了。...
分类:
编程语言 时间:
2014-05-21 15:58:40
阅读次数:
240
【题目】
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
【题意】
给定用字符串表示的整数,返回两个数的乘积结果字符串。两个数字都非负,且能任意大。
【思路】
1. 考虑其中一个数是0的情况
2. 模拟乘法运算...
分类:
其他好文 时间:
2014-05-21 13:45:37
阅读次数:
214
There are two types of non-blocking thread synchronization algorithms
- lock-free, and wait-free. Their meaning is often confused. In lock-free systems, while any particular computation may be block...
分类:
其他好文 时间:
2014-05-21 10:27:20
阅读次数:
410