The Fourth Dimension Space

枯叶北风寒,忽然年以残,念往昔,语默心酸。二十光阴无一物,韶光贱,寐难安; 不畏形影单,道途阻且慢,哪曲折,如渡飞湍。斩浪劈波酬壮志,同把酒,共言欢! -如梦令



1Two Sum25arraysort

    setTwo Pointers

2Add Two Numbers34linked listTwo Pointers


3Longest Substring Without Repeating Characters32stringTwo Pointers


4Median of Two Sorted Arrays53arrayBinary Search

5Longest Palindromic Substring42string 

6ZigZag Conversion31string 

7Reverse Integer23 Math

8String to Integer (atoi)25stringMath

9Palindrome Number22 Math

10Regular Expression Matching53stringRecursion


11Container With Most Water32arrayTwo Pointers

12Integer to Roman34 Math

13Roman to Integer24 Math

14Longest Common Prefix21string 

153Sum35arrayTwo Pointers

163Sum Closest31arrayTwo Pointers

17Letter Combinations of a Phone Number33stringDFS


19Remove Nth Node From End of List23linked listTwo Pointers

20Valid Parentheses25stringStack

21Merge Two Sorted Lists25linked listsort

     Two Pointers


22Generate Parentheses34stringDFS

23Merge k Sorted Lists34linked listsort

    heapTwo Pointers


24Swap Nodes in Pairs24linked list 

25Reverse Nodes in k-Group42linked listRecursion

     Two Pointers

26Remove Duplicates from Sorted Array13arrayTwo Pointers

27Remove Element14arrayTwo Pointers

28Implement strStr()45stringTwo Pointers


     rolling hash

29Divide Two Integers43 Binary Search


30Substring with Concatenation of All Words31stringTwo Pointers

31Next Permutation52arraypermutation

32Longest Valid Parentheses41stringDP

33Search in Rotated Sorted Array43arrayBinary Search

34Search for a Range43arrayBinary Search

35Search Insert Position22array 

36Valid Sudoku22array 

37Sudoku Solver42arrayDFS

38Count and Say22stringTwo Pointers

39Combination Sum33arraycombination

40Combination Sum II42arraycombination

41First Missing Positive52arraysort

42Trapping Rain Water42arrayTwo Pointers


43Multiply Strings43stringTwo Pointers


44Wildcard Matching53stringRecursion



45Jump Game II42array 


47Permutations II42arraypermutation

48Rotate Image42array 



50Pow(x, n)35 Binary Search



52N-Queens II43arrayDFS

53Maximum Subarray33arrayDP

54Spiral Matrix42array 

55Jump Game32array 

56Merge Intervals45arraysort

    linked listmerge

    red-black tree 

57Insert Interval45arraysort

    linked listmerge

    red-black tree 

58Length of Last Word11string 

59Spiral Matrix II32array 

60Permutation Sequence51 permutation


61Rotate List32linked listTwo Pointers

62Unique Paths23arrayDP

63Unique Paths II33arrayDP

64Minimum Path Sum33arrayDP

65Valid Number25stringMath

66Plus One12arrayMath

67Add Binary24stringTwo Pointers


68Text Justification42string 

69Sqrt(x)44 Binary Search

70Climbing Stairs25 DP

71Simplify Path31stringStack

72Edit Distance43stringDP

73Set Matrix Zeroes35array 

74Search a 2D Matrix33arrayBinary Search

75Sort Colors42arraysort

     Two Pointers

76Minimum Window Substring42stringTwo Pointers

77Combinations34 combination



79Word Search34arrayDFS

80Remove Duplicates from Sorted Array II22arrayTwo Pointers

81Search in Rotated Sorted Array II53arrayBinary Search

82Remove Duplicates from Sorted List II33linked listRecursion

     Two Pointers

83Remove Duplicates from Sorted List13linked list 

84Largest Rectangle in Histogram52arrayStack

85Maximal Rectangle51arrayDP


86Partition List33linked listTwo Pointers

87Scramble String52stringRecursion


88Merge Sorted Array25arrayTwo Pointers


89Gray Code42 combination

90Subsets II42arrayRecursion


91Decode Ways34stringRecursion


92Reverse Linked List II32linked listTwo Pointers

93Restore IP Addresses33stringDFS

94Binary Tree Inorder Traversal43treeRecursion



95Unique Binary Search Trees II41treeDP


96Unique Binary Search Trees31treeDP

97Interleaving String52stringRecursion


98Validate Binary Search Tree35treeDFS

99Recover Binary Search Tree42treeDFS

100Same Tree11treeDFS

101Symmetric Tree12treeDFS

102Binary Tree Level Order Traversal34treeBFS

103Binary Tree Zigzag Level Order Traversal43queueBFS


104Maximum Depth of Binary Tree11treeDFS

105Construct Binary Tree from Preorder and Inorder Tr33arrayDFS


106Construct Binary Tree from Inorder and Postorder T33arrayDFS


107Binary Tree Level Order Traversal II31treeBFS

108Convert Sorted Array to Binary Search Tree23treeDFS

109Convert Sorted List to Binary Search Tree43linked listRecursion

     Two Pointers

110Balanced Binary Tree12treeDFS

111Minimum Depth of Binary Tree11treeDFS

112Path Sum13treeDFS

113Path Sum II22treeDFS

114Flatten Binary Tree to Linked List33treeRecursion


115Distinct Subsequences42stringDP

116Populating Next Right Pointers in Each Node33treeDFS

117Populating Next Right Pointers in Each Node II42treeDFS

118Pascal's Triangle21array 

119Pascal's Triangle II21array 


121Best Time to Buy and Sell Stock21arrayDP

122Best Time to Buy and Sell Stock II31arraygreedy

123Best Time to Buy and Sell Stock III41arrayDP

124Binary Tree Maximum Path Sum42treeDFS

125Valid Palindrome25stringTwo Pointers

126Word Ladder II11  

127Word Ladder35graphBFS

     shortest path

128Longest Consecutive Sequence43array 

129Sum Root to Leaf Numbers24treeDFS

130Surrounded Regions43arrayBFS


131Palindrome Partitioning34stringDFS

132Palindrome Partitioning II43stringDP

posted on 2013-09-16 22:18 abilitytao 阅读(9738) 评论(0)  编辑 收藏 引用

【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理