原创 [leetcode] Anagrams
Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. 原
原创 [leetcode] Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time comple
原创 [leetcode] 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retu
原创 [leetcode] First Missing Positive
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3
原创 [leetcode] Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled,
原创 [leetcode] 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in
原创 白話經典算法系列之七 堆與堆排序
原文鏈接:http://blog.csdn.net/morewindows/article/details/6709644 堆排序與快速排序,歸併排序一樣都是時間複雜度爲O(N*logN)的幾種常見排序方法。學習堆排序前,先講解下什麼是
原创 [leetcode] Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ...
原创 [leetcode] 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all un
原创 [leetcode] Integer to Roman
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 參考鏈接:htt
原创 [leetcode] Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in o
原创 [leetcode] Largest Rectangle in Histogram
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area
原创 [leetcode] Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1
原创 Tcpdump命令詳解
簡介 原文連接:http://www.cnblogs.com/ggjucheng/archive/2012/01/14/2322659.html 用簡單的話來定義tcpdump,就是:dump the traffic on a
原创 取石子問題
原文鏈接:http://www.cnblogs.com/celia01/archive/2011/11/15/2250171.html 取石子問題 有一種很有意思的遊戲,就是有物體若干堆,可以是火柴棍或是圍棋子等等均可。兩個人輪流