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 ...
分类:
其他好文 时间:
2014-06-28 10:45:34
阅读次数:
225
本章节我们重点分析Cocos2d-x3.0与 场景、层相关的源码。这部分源码集中在 libcocos2d –> layers_scenes_transitions_nodes目录下面我先发个截图大家了解一下都有哪些文件。红色框里面的就是我们今天要分析的文件。从命名上可以了解,这个文件夹里的文件主要包...
分类:
其他好文 时间:
2014-06-28 10:35:10
阅读次数:
213
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.No...
分类:
其他好文 时间:
2014-06-25 23:36:53
阅读次数:
291
特定容器算法
lst.merge(lst2)
将来自lst2的元素并入到lst。这两个都必须是有序的。
lst.merge(lst2, comp)
元素将从lst2删除,第一个版本使用
lst.remove(lst2)调用erase删除掉与给定值相等(==)或令一元谓词为真的每个元素
lst.remove_if(pred)
lst.reverse() 反转...
分类:
编程语言 时间:
2014-06-25 19:32:39
阅读次数:
200
【问题】
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
...
分类:
编程语言 时间:
2014-06-24 23:22:53
阅读次数:
331
本章节我们重点分析Cocos2d-x3.0与 场景、层相关的源码。这部分源码集中在 libcocos2d –> layers_scenes_transitions_nodes目录下面
我先发个截图大家了解一下都有哪些文件。红色框里面的就是我们今天要分析的文件。
从命名上可以了解,这个文件夹里的文件主要包含了 场景,层,变换这三种类型的文件。
下面我们先分析Scene类
打开C...
分类:
其他好文 时间:
2014-06-24 22:35:00
阅读次数:
172
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes' values.
For example,
Given {1,2,3,4}, reorder it t...
分类:
其他好文 时间:
2014-06-24 21:55:30
阅读次数:
279
题目:Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about...
分类:
其他好文 时间:
2014-06-24 14:12:18
阅读次数:
184
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive soluti...
分类:
其他好文 时间:
2014-06-22 16:37:51
阅读次数:
168
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bonus points for y...
分类:
其他好文 时间:
2014-06-22 09:31:16
阅读次数:
220