摘要: Question Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1 2 3 4, you should return the list as 2 1 4 3. Yo 阅读全文
posted @ 2017-02-26 17:19 清水汪汪 阅读(144) 评论(0) 推荐(1) 编辑
摘要: Question: Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1 2 3 4 5, and n = 2. Aft 阅读全文
posted @ 2017-02-23 23:57 清水汪汪 阅读(151) 评论(0) 推荐(1) 编辑
摘要: Question Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文
posted @ 2017-02-22 23:08 清水汪汪 阅读(109) 评论(0) 推荐(1) 编辑
摘要: LeetCode Valid Parentheses Question Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is va 阅读全文
posted @ 2017-02-21 16:48 清水汪汪 阅读(146) 评论(0) 推荐(1) 编辑
摘要: 编辑距离 在计算机科学中,编辑距离是一种量化两个字符串差异程度的方法,也就是计算从一个字符串转换成另外一个字符串所需要的最少操作步骤。不同的编辑距离中定义了不同操作的集合。比较常用的莱温斯坦距离(Levenshtein distance)中定义了:删除、插入、替换操作。 算法描述 定义edit(i, 阅读全文
posted @ 2016-12-08 22:44 清水汪汪 阅读(1186) 评论(1) 推荐(1) 编辑
摘要: 目的 如何遍历图像中的每一个像素? OpenCV的矩阵值是如何存储的? 如何测试我们所实现算法的性能? 查找表是什么?为什么要用它? 测试用例 颜色空间缩减。具体做法就是:将现有颜色空间值除以某个输入值,以获得较少的颜色数。例如,颜色0到9可取为新值0,10到19可取为10。 计算公式: Lnew 阅读全文
posted @ 2016-12-05 21:53 清水汪汪 阅读(1420) 评论(0) 推荐(1) 编辑
摘要: Mat 基本图像容器 世间的图像是各种各样的,但是到了计算机的世界里所有的图像都简化为了 数值矩以及矩阵信息 。作为一个计算视觉库,OpenCV的主要目的就是处理和操作这些信息,来获取更高级的信息,也就是潜在的价值。因此,我们需要首先学习OpenCV是如何 存储并操作图像的 。 Mat 2001年O 阅读全文
posted @ 2016-12-05 20:50 清水汪汪 阅读(1320) 评论(0) 推荐(1) 编辑
摘要: 读取、修改、保存图像 图像读取函数imread(); 图像颜色空间的转换cvtColor(); 图像保存至硬盘imwrite(); C++ / Author: zhonghuasong Email: zhonghsuestc@163.com Create Time: 2016 12 03 15:03 阅读全文
posted @ 2016-12-05 20:26 清水汪汪 阅读(575) 评论(0) 推荐(1) 编辑
摘要: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2016-11-29 22:39 清水汪汪 阅读(218) 评论(0) 推荐(1) 编辑
摘要: 目前,为了加速页面的加载速度,页面的很多部分都是用JS生成的,而对于用scrapy爬虫来说就是一个很大的问题,因为scrapy没有JS engine,所以爬取的都是静态页面,对于JS生成的动态页面都无法获得。 解决方案: 利用第三方中间件来提供JS渲染服务: "scrapy splash" 等。 利 阅读全文
posted @ 2016-10-19 09:13 清水汪汪 阅读(31078) 评论(1) 推荐(3) 编辑