原创 Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row

原创 Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and

原创 Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines

原创 webbench 源碼剖析

webbench 代碼不超過500行,比較小巧! 轉自:http://www.cnblogs.com/xuning/p/3888699.html Webbench是一個在linux下使用的非常簡單的網站壓測工具。它使用fork()模擬

原创 Sort Colors

Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are a

原创 leetcode 目錄--更新....

 //注:很多代碼未加入,內存分配是否成功的判斷! //二維數組分配問題需注意,leetcode 可以接受變量的a[m][n],自己實現需,int **a = new int [m];for(){a[i] = new int[n]} --

原创 二叉樹中兩個節點的最近公共父節點

二叉樹中兩個節點的最近公共父節點,很熟悉的題目,此題在劍指offer上有,個人的思路,即爲通過遍歷分別獲取到倆條鏈表之後在比較求出公共節點。對於爲二叉搜索樹而言,只需通過遍歷,其值位於倆者之間即可(比較前,先找出誰大誰小)。 對與此題,無

原创 Linux環境進程間通信(二): 信號

原文來自: http://www.ibm.com/developerworks/cn/linux/l-ipc/part2/index1.html#icomments  該文對信號總結的很好,轉載於此,並感謝原作者。 原文作者:鄭彥興 (m

原创 Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wor

原创 awk 中單引號的問題

對於shell 對雙引號會對$,\,' 進行擴展,而使用單引號則,裏面的內容會直接傳給awk 作爲參數處理。 其中awk,內部有自己的處理原則。輸出字符串時使用“”,對於內建變量使用$1等,也可以傳進參數 放在末尾。 其中awk 對於 單

原创 多個正則引擎的比較(pcre re2 hyperscan)

A comparison of regex engines (多個正則引擎的比較) https://rust-leipzig.github.io/regex/2017/03/28/comparison-of-regex-engines

原创 Netfilter的使用和實現

本文主要內容:Netfilter的原理和實現淺析,以及示例模塊。 內核版本:2.6.37 Author:zhangskd @ csdn blog 原文章地址: http://blog.csdn.net/zhangskd/a

原创 類似無窮期望概率題

首先介紹:兩個人拋硬幣來決定誰吃這個蘋果,先拋到正面者吃。問先拋者吃到蘋果的概率是多少? 此種,先假設某種情況,需要P,再根據下一個狀態推出遞推方程,即可求解。 以下借鑑: http://www.matrix67.com/blog/ar

原创 Remove Element

Given an array and a value, remove all instances of that value in place and return the new length. The order of eleme

原创 Anagrams

Given an array of strings, return all groups of strings that are anagrams.(返回有爲迴文構詞法的組) Note: All inputs will be in l