原题地址:https://oj.leetcode.com/problems/simplify-path/题意:Given
an absolute path for a file (Unix-style), simplify it.For example,path="/home/",
=>"/home...
分类:
编程语言 时间:
2014-06-09 19:13:54
阅读次数:
181
Map-reduce是一种优雅的数据处理方式,本文通过三个例子介绍如何用python在linux的管道进行map-reduce编程,本文写的所有map-reduce程序都可以原封不动的放在Hadoop下运行,很容易在大数据集上扩展。
分类:
其他好文 时间:
2014-06-09 19:11:44
阅读次数:
253
原题地址:https://oj.leetcode.com/problems/scramble-string/题意:Given
a strings1, we may represent it as a binary tree by partitioning it to two
non-empty su...
分类:
编程语言 时间:
2014-06-09 19:02:59
阅读次数:
197
1. python -m cProfile myprogram.py2. 使用import
profile模块import profiledef profileTest(): ...if __name__ == "__main__":
profile.run("profileTest()")3......
分类:
编程语言 时间:
2014-06-09 18:59:10
阅读次数:
219
原题地址:https://oj.leetcode.com/problems/search-in-rotated-sorted-array/题意:Suppose
a sorted array is rotated at some pivot unknown to you beforehand.(i.e...
分类:
编程语言 时间:
2014-06-09 18:43:14
阅读次数:
273
元字符 "{n}"、"{n,}"、"{n,m}""{n}"
匹配确定的n次(n是一个非负整数)。例如:o{2}能匹配“zoo”。"{n,}"
匹配至少n次(n是一个非负整数)。例如:o{1,}能匹配“zo”以及“zoo”。"{n,m}"
匹配n至m次,n<=m,最少n次且最多m次,(n,m均为非负整...
分类:
其他好文 时间:
2014-06-09 18:13:12
阅读次数:
233
编写程序统计并输出所读入的单词出现的次数想与习题10-1相结合,也就是先输入几组
map类型,存入vector中。再输入单词word,如果已经存在则在key对应的value+1如果不存在,则插入并使得其value为1.之前的问题是-》输入了一次之后,再要输入单词word,读不进。(呵呵
果然小白)看...
分类:
编程语言 时间:
2014-06-09 18:04:12
阅读次数:
228
1.关于pippip是python的软件安装工具,下面是pip的使用方法:(1)安装包:pip
install SomePackage(2)查看安装包时安装了哪些文件:pip show --files SomePackage(3)查看哪些包有更新:pip
show --files SomePacka...
分类:
编程语言 时间:
2014-06-09 17:58:04
阅读次数:
240
原题地址:https://oj.leetcode.com/problems/combination-sum/题意:Given
a set of candidate numbers (C) and a target number (T), find all unique
combinations in...
分类:
编程语言 时间:
2014-06-09 17:50:09
阅读次数:
333
原题地址:https://oj.leetcode.com/problems/first-missing-positive/题意:Given
an unsorted integer array, find the first missing positive integer.For
example,G...
分类:
编程语言 时间:
2014-06-09 17:44:43
阅读次数:
980