原题地址:https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/题意:Evaluate
the value of an arithmetic expression inReverse Polish Notation.Val...
分类:
编程语言 时间:
2014-06-03 11:18:22
阅读次数:
335
原题地址:https://oj.leetcode.com/problems/reverse-words-in-a-string/题意:Given
an input string, reverse the string word by word.For example,Given s = "the s...
分类:
编程语言 时间:
2014-06-03 11:13:36
阅读次数:
258
原题地址:https://oj.leetcode.com/problems/word-break/题意:Given
a stringsand a dictionary of wordsdict, determine ifscan be segmented into a
space-separated...
分类:
编程语言 时间:
2014-06-03 09:14:24
阅读次数:
293
List Comprehension1.列表推导 [i for i in range(10) if
i%2 == 0] -> [0, 2, 4, 6, 8], i也可以是一个函数,该风格比C语言思想的代码风格效率高2.enumerate
取到了序列中的序列号好内容forindex,iteminenu...
分类:
编程语言 时间:
2014-06-03 09:08:01
阅读次数:
254
原题地址:https://oj.leetcode.com/problems/max-points-on-a-line/题意:Givennpoints
on a 2D plane, find the maximum number of points that lie on the same strai...
分类:
编程语言 时间:
2014-06-03 08:55:48
阅读次数:
282
(转载请注明出处:http://blog.csdn.net/buptgshengod)1.背景
接着上一节说,没看到请先看一下上一节关于数据集的划分数据集划分。如今我们得到了每一个特征值得信息熵增益,我们依照信息熵增益的从大到校的顺序,安排排列为二叉树的节点。数据集和二叉树的图见下。(二叉树的图是....
分类:
编程语言 时间:
2014-06-03 07:23:48
阅读次数:
325
原题地址:https://oj.leetcode.com/problems/word-break-ii/题意:Given
a stringsand a dictionary of wordsdict, add spaces insto construct a sentence
where each ...
分类:
编程语言 时间:
2014-06-03 07:13:21
阅读次数:
339
晚上打算把播放器下载下来的音乐拷贝到mp3里边,但是它是如下形式存放的,相当头痛……作为程序员,想到使用python来遍历这个目录,并将有大于限制的音乐文件拷贝到指定目录,相关实现代码如下:#
author:liaoyu# date :2014-05-30import osimport reimp....
分类:
编程语言 时间:
2014-05-30 17:48:56
阅读次数:
366
写在前面前文:用python + hadoop streaming 编写分布式程序(一) --
原理介绍,样例程序与本地调试为了方便,这篇文章里的例子均为伪分布式运行,一般来说只要集群配置得当,在伪分布式下能够运行的程序,在真实集群上也不会有什么问题。为了更好地模拟集群环境,我们可以在mapred-...
分类:
编程语言 时间:
2014-05-30 14:56:56
阅读次数:
309
不同的编程语言都有各自的代码组织和复用的方式,如.net、php中的命名空间,python中的import,ruby中的module等,来避免命名空间污染。一直都没搞清楚node中的exports和module.exports的区别,借此搞清楚node的代码模块复用方式。首先怎么创建node中的mo...
分类:
Web程序 时间:
2014-05-30 14:47:27
阅读次数:
236