小小程序媛  
得之坦然,失之淡然,顺其自然,争其必然

2015年10月9日

摘要: 题目Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algo... 阅读全文
posted @ 2015-10-09 21:33 Coding菌 阅读(102) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return分析构建数字金字塔,由上图可以清楚的找到规律。该题目可用递归实现!比较简单~... 阅读全文
posted @ 2015-10-09 21:22 Coding菌 阅读(114) 评论(0) 推荐(0) 编辑
 
摘要: 题目Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any posit... 阅读全文
posted @ 2015-10-09 21:08 Coding菌 阅读(152) 评论(0) 推荐(0) 编辑
 
摘要: 简单的抓取网页import urllib.request url="http://google.cn/" response=urllib.request.urlopen(url) #返回文件对象page=response.read()直接将URL保存为本地文件impor... 阅读全文
posted @ 2015-10-09 20:04 Coding菌 阅读(556) 评论(0) 推荐(0) 编辑
 
摘要: 一、cpu信息cpu信息存储在/proc文件系统的cpuinfo(/proc/cpuinfo)文件里,可以直接查看这个文件以获得cpu信息,所列字段解释如下:processor : 核心编号,如:0,1,2,3等。 vendor_id : ... 阅读全文
posted @ 2015-10-09 10:49 Coding菌 阅读(2845) 评论(0) 推荐(0) 编辑