- 博客(12)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 Go concurrent crawler
下面是a tour of go 中最后一个练习的解法,本文使用了真正的网络io来运行爬虫,由于没有对连接数做限制,所以当depth为3时会发生错误package mainimport ( "fmt" "log" "strings" "sync" "github.com/PuerkitoBio/goquery")type Fetcher interface {
2017-12-29 20:19:18 384
原创 rot13Reader
package mainimport ( "io" "os" "strings")type rot13Reader struct { r io.Reader}func (rot rot13Reader) Read(b []byte) (n int, err error){ left:=len(b) for{ length,stat
2017-12-27 18:23:57 320
原创 397. Longest Increasing Continuous Subsequence
class Solution: """ @param: A: An array of Integer @return: an integer """ def longestIncreasingContinuousSubsequence(self, A): # write your code here if len(A)==0:
2017-12-24 12:12:31 216
原创 115. Unique Paths II
class Solution: """ @param: obstacleGrid: A list of lists of integers @return: An integer """ def uniquePathsWithObstacles(self, obstacleGrid): # write your code here
2017-12-24 12:04:53 190
原创 114. Unique Paths
class Solution: """ @param: m: positive integer (1 <= m <= 100) @param: n: positive integer (1 <= n <= 100) @return: An integer """ def uniquePaths(self, m, n): # write
2017-12-24 11:55:24 194
原创 111. Climbing Stairs
class Solution: """ @param n: An integer @return: An integer """ def climbStairs(self, n): # write your code here if n==0: return 0 if n==1:
2017-12-24 11:46:53 163
原创 110.Minimum Path Sum
class Solution: """ @param: grid: a list of lists of integers @return: An integer, minimizes the sum of all numbers along its path """ def minPathSum(self, grid): # write yo
2017-12-24 11:41:41 166
原创 109.triangle
class Solution: """ @param: triangle: a list of lists of integers @return: An integer, minimum path sum """ def minimumTotal(self, triangle): # write your code here
2017-12-24 11:31:50 181
原创 514. Paint Fence
class Solution {public: /* * @param n: non-negative integer, n posts * @param k: non-negative integer, k colors * @return: an integer, the total number of ways */ int numWa
2017-12-24 11:16:09 165
原创 kmp算法
#define MAX 10000void getNext(char *p,int next[]){ int p_len=strlen(p); next[0]=-1; next[1]=0; for (int i=2;i<p_len;i++){ int q=next[i-1]; while (q!=0 && p[q]!=p[i-1])
2017-12-23 00:20:48 144
原创 最长递增子序列(nlogn)
#define MAX 1000000int find(int a[],int x,int l,int r){ while (l<=r){ int mid=(l+r)/2; if (a[mid]==x) return mid; if (a[mid]<x) l=mid+1; els
2017-12-22 19:30:05 818
原创 排序算法大合集
#include<stdlib.h>#include<unistd.h>#include<stdio.h>#include<unistd.h>#include<sys/wait.h>#include<time.h>#define MAX 10000int check(int a[],int n){ for (int i=0;i<n-1;i++) if (a[i]>
2017-12-22 14:58:20 174
怎样从U盘安装kali linux2.0?
2015-08-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人