LeetCode解题报告(31)--数字排列的下一项
原题如下: >Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
据说这是面试中被问频率非常高的一个问题,下面做简单的记录:
Java中的java.util.Iterator
和java.util.Enumeration
均可用来遍历Java中的集合框架(list,map,set等)。
原题如下: >Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
原题如下: >Given an array and a value, remove all instances of that value in place and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
原题如下: >Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory.
原题如下: >Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
本文主要讲述了通过 python
实现的用于下载搜狗、百度、QQ三个输入法的词库的爬虫的实现原理。主要利用了python自带的urllib2
、Queue
、re
、threading
模块,并分别通过单线程和多线程实现。最后会给出完整的源码地址。