题目连接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=9213913904156AnanagramsAcceptedC++0.0092014-07-20 ...
分类:
其他好文 时间:
2014-07-22 08:07:37
阅读次数:
225
下标脚本 可以定义在类(Class)、结构体(structure)和枚举(enumeration)这些目标中,可以让这些类型的实例通过[]快速访问属性和方法. subscript(index: Int) -> Int { get { // 返回与入参匹配的Int类型的值 } ...
分类:
其他好文 时间:
2014-07-22 08:04:36
阅读次数:
195
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:
编程语言 时间:
2014-07-22 00:39:35
阅读次数:
263
#import "ViewController.h"#import @interface ViewController (){ AVAudioPlayer *play; int index; NSArray *audiolist; NSMutableArray *imagel...
分类:
其他好文 时间:
2014-07-22 00:38:36
阅读次数:
241
Another recursion problem.class Solution {public: int getHeight(TreeNode *p) { if (!p) return 0; int hL = 1; if (p->left) h...
分类:
其他好文 时间:
2014-07-21 11:10:03
阅读次数:
180
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=17561391360710815Andy's First DictionaryAcceptedC+...
分类:
其他好文 时间:
2014-07-21 08:26:16
阅读次数:
243
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Runtime.Serialization.Formatters.Binary;using System.Text...
分类:
其他好文 时间:
2014-07-21 08:03:51
阅读次数:
197
用grep来搜代码和方便,最原生态了,常用的: ??~?grep?‘NuPlayer‘?-iInr?--color?./aosp 其中`i`表示大小写忽略;`I`表示忽略binary文件;`n`显示搜索结果的行号;`r`表示递归搜索子目录 不过grep搜索有点...
分类:
其他好文 时间:
2014-07-20 23:30:42
阅读次数:
446
关于二叉树的遍历有很多的方法, 下面介绍两个经典的遍历算法: BFS和DFS。一个是深度优先遍历, 一个是广度有优先遍历。 这两种遍历算法均属于盲目的遍历算法, 一般而言, 启发式的遍历搜索算法比较好一些。 。 关于各种遍历算法的对比, 将会在后面逐一提及。 这里不在赘述。
由于树是一个非线性的数据结构, 显然不能像linked list , 或者Array那样通过从头像最末尾移动去实现遍历每一...
分类:
编程语言 时间:
2014-07-20 23:14:21
阅读次数:
387
简单的二叉树的先根遍历模板的应用
class Solution:
# @param root, a tree node
# @return an integer
def hehe(self, num, root):
#再原来的基础上*10,再加上当前的root.val
num = num * 10 + root.val
...
分类:
其他好文 时间:
2014-07-20 22:45:33
阅读次数:
299