原创 LeetCode算法題之Multiply Strings

問題描述: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbe

原创 LeetCode算法題之Valid Parentheses

問題描述: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is v

原创 LeetCode算法題之Rotate Image

問題描述: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow

原创 LeetCode算法題之int to Roman

問題描述: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.

原创 LeetCode算法題之Count and Say

//問題描述 The count-and-say sequence is the sequence of integers beginning as

原创 LeetCode算法題之Pow(x, n)

問題描述: Implement pow(x, n).自己寫函數實現乘方運算 解題思路: 直接實現肯定超時,並且要考慮指數爲0,指數爲1,指數爲負,底數爲0的特殊情況,此題用遞歸方法實現, 以下代碼來自《劍指offer》,此代碼寫的太讚了

原创 Flume-ng 多節點集羣搭建

Flume NG是一個分佈式、可靠、可用的系統,它能夠將不同數據源的海量日誌數據進行高效收集、聚合,最後存儲到一箇中心化數據存儲系統中,方便進行數據分析。事實上flume也可以收集其他信息,不僅限於日誌。由原來的Flume OG到

原创 LeetCode算法題之Anagrams

問題描述: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lowe

原创 LeetCode算法題之Remove Duplicates from Sorted Array

問題描述: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new

原创 POJ之1012

問題描述: 有k個壞人k個好人坐成一圈,前k個爲好人(編號1~k),後k個爲壞人(編號k+1~2k),現在從編號1開始報數,一直報到m,一 輪結束後,必須要求第m個報數的人死掉,而且他要是壞人,在他死掉之後繼續從他的下一個開始報數,也是

原创 POJ之1007

題目鏈接:poj.org/problem?id=1007 /* "DEABC",對於D有ABC三個按照字母順序排列應該排在D前,此時在D後故,對D有逆序個數3,對於E同理逆序個數3,ABC均爲正序,故整個字符串逆序程度爲3 對於DNA序列

原创 LeetCode算法題之Valid Sudoku

問題描述: Determine if a Sudoku is valid, according to: http://sudoku.com.au/TheRules.aspx The Sudoku board could be

原创 POJ之1014

/* 兩人分石頭,要求平分,但石頭大小不一,價值也不一樣,從1到20000,如果一堆石頭的總價是奇數顯然不可分,則輸出不可分割 否則再看這堆石頭是否能被分成兩份,在保證石頭完好無損的情況下。 輸入1 0 1 2 0 0代表價值爲1的1個,

原创 自學數據挖掘十大算法之CART

分類與迴歸樹(Classification andRegression Trees, CART)算法由Breiman等人於1984年提出,是分類數據挖掘算法的其中一種。CART採用一種二分遞歸分割的技術,將當前的樣本集分爲兩個子樣本集,

原创 Python爬蟲爬取百度搜索結果——郵箱地址

因爲需要拿一些外部郵箱做測試,所以要獲得一些真實的郵箱地址,我在百度上搜索"@xxxx.com.cn"(xxxx保密,哈哈)之後,得到大概1,700,000條結果。但我只需要一千個不重複的就夠了,鼓搗了一下午終於搞定,直接貼上代碼,具