Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two...
分类:
其他好文 时间:
2014-06-11 00:35:15
阅读次数:
243
定义及应用
定义
stuff = {'name': 'Zed', 'age': 36, 'height': 6*12+2}#key:value pairs
实例
# create a mapping of state to abbreviation
states = {
'Oregon': 'OR',
'Florida': 'FL',
'California':...
分类:
编程语言 时间:
2014-06-10 15:46:14
阅读次数:
266
今天发现自己连Bundle类都没有搞清楚,于是花时间研究了一下。依据google官方的文档(http://developer.android.com/reference/android/os/Bundle.html)Bundle类是一个key-value对,“A
mapping from Strin...
分类:
移动开发 时间:
2014-06-10 00:36:28
阅读次数:
247
题目:Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL...
分类:
其他好文 时间:
2014-06-09 23:03:18
阅读次数:
254
脏数据检查 != 轮询检查更新谈起angular的脏检查机制(dirty-checking),
常见的误解就是认为: ng是定时轮询去检查model是否变更。其实,ng只有在指定事件触发后,才进入$digest cycle:
DOM事件,譬如用户输入文本,点击按钮等。(ng-click)XHR响应事...
分类:
其他好文 时间:
2014-06-09 16:26:40
阅读次数:
223
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-06-08 15:30:28
阅读次数:
227
题目
A message containing letters from A-Z is being encoded to numbers using
the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine ...
分类:
其他好文 时间:
2014-06-08 15:30:08
阅读次数:
182
题目如下:
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
click to show clarification.
Clarification:
What co...
分类:
其他好文 时间:
2014-06-08 14:58:13
阅读次数:
231
题目
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321。
解题思路:
颠倒一个整数中数字的位置,哈哈,类似翻转字符串一样,只不过整数需要计算,需要考虑溢出,其他无而。写出代码不难,只是溢出的时候怎么办,我这里是按照返回-1处理的,在leetcode上可以AC。
代码实现:...
分类:
其他好文 时间:
2014-06-08 14:47:58
阅读次数:
257
Evaluate the value of an arithmetic expression
in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be
an integer or another ex...
分类:
其他好文 时间:
2014-06-07 20:34:41
阅读次数:
214