Rockwall

导航

2016年8月11日 #

LeetCode 【47. Permutations II】

摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following unique pe 阅读全文

posted @ 2016-08-11 19:37 Rockwall 阅读(717) 评论(0) 推荐(0)

LeetCode 【46. Permutations】

摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 代码 阅读全文

posted @ 2016-08-11 17:30 Rockwall 阅读(239) 评论(0) 推荐(0)

2016年8月8日 #

Python asyncio库的学习和使用

摘要: 因为要找工作,把之前自己搞的爬虫整理一下,没有项目经验真蛋疼,只能做这种水的不行的东西。。。T T,希望找工作能有好结果。 之前爬虫使用的是requests+多线程/多进程,后来随着前几天的深入了解,才发现,对于爬虫来说,真正的瓶颈并不是CPU的处理速度,而是对于网页抓取时候的往返时间,因为如果采用 阅读全文

posted @ 2016-08-08 20:50 Rockwall 阅读(8765) 评论(0) 推荐(0)

2016年8月6日 #

LeetCode 【190. Reverse Bits】

摘要: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文

posted @ 2016-08-06 16:59 Rockwall 阅读(184) 评论(0) 推荐(0)

LeetCode 【21. Merge Two Sorted Lists】

摘要: 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 @ 2016-08-06 16:07 Rockwall 阅读(171) 评论(0) 推荐(0)

LeetCode 【235. Lowest Common Ancestor of a Binary Search Tree】

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文

posted @ 2016-08-06 15:56 Rockwall 阅读(154) 评论(0) 推荐(0)

LeetCode【217. Contains Duplicate】

摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文

posted @ 2016-08-06 15:49 Rockwall 阅读(445) 评论(0) 推荐(0)

LeetCode【169. Majority Element】

摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文

posted @ 2016-08-06 15:31 Rockwall 阅读(228) 评论(0) 推荐(0)

2016年8月5日 #

排序算法总结(四)快速排序【QUICK SORT】

摘要: 感觉自己这几篇都是主要参考的Wikipedia上的,快排就更加是了。。。。wiki上的快排挺清晰并且容易理解的,需要注意的地方我也添加上了注释,大家可以直接看代码。需要注意的是,wikipedia上快排的pivot选择的是末尾的数,而不是随机数 阅读全文

posted @ 2016-08-05 20:16 Rockwall 阅读(329) 评论(0) 推荐(0)

排序算法总结(三)选择排序【Select Sort】

摘要: 一.原理 选择排序的原理非常简单,就是选出最小(大)的数放在第一位,在剩下的数中,选出最小(大)的数,放在第二位......重复上述步骤,直到最后一个数。 二.过程 原始数据 第一次排序,选出最小的数1,交换1与25的位置 第二次排序,选出剩下的数据中最小的数4,交换7与4的位置 重复以上过程,最后 阅读全文

posted @ 2016-08-05 16:22 Rockwall 阅读(702) 评论(0) 推荐(0)