摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. KMP算法,很久没写了,这个题目正好复习一下 K 阅读全文
posted @ 2016-08-24 12:31 sfeiqiang 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-08-23 12:21 sfeiqiang 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num = 5, return f 阅读全文
posted @ 2016-08-21 13:13 sfeiqiang 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 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. Your 阅读全文
posted @ 2016-08-21 12:23 sfeiqiang 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 不用递归和循环,这里有一 阅读全文
posted @ 2016-08-21 00:11 sfeiqiang 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The 阅读全文
posted @ 2016-08-14 12:53 sfeiqiang 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Python爬虫总结(二)常见数据类型 上一篇我们简单介绍了如何用Python发送 http/https 请求获取网上数据,从web上采集回来的数据的数据类型有很多种,主要有: 注意:这里很多概念都是web前端开发里的,因为我们采集的大多数数据都来自web,因此了解一些前端知识还是挺有必要的. 下面 阅读全文
posted @ 2016-07-31 19:00 sfeiqiang 阅读(3757) 评论(0) 推荐(0) 编辑
摘要: Python爬虫总结(一)入门 很多做数据分析的同学会抱怨没有实际数据,感觉巧妇难为无米之炊,而火车头采集器一类的软件很难完成一些定制性很强的数据采集任务,这时候就需要自己编写爬虫来采集数据了。python是目前做爬虫比较流行的工具。 爬虫的一般原理 爬虫一般通过发送http/https请求,从服务 阅读全文
posted @ 2016-07-30 11:29 sfeiqiang 阅读(1001) 评论(0) 推荐(0) 编辑
摘要: 自己编写一个简单的微博爬虫 前言 很多做社交媒体数据分析的同学需要采集一些新浪微博上的数据,新浪微博虽然有提供api,但免费的api对获取的数据项和获取的频率都有很大的限制,商业版api据说限制较少,但是作为屌丝学生党拿来那么多钱买买商业版的api?!!!用类似于火车头采集器这种工具又很难解决问题, 阅读全文
posted @ 2016-07-29 22:03 sfeiqiang 阅读(7732) 评论(1) 推荐(1) 编辑