(1) Linked List:
- 2-add-two-numbers,2.cpp
- 19-remove-nth-node-from-end-of-list,TBD
- 21-merge-two-sorted-lists,TBD
- 83-remove-duplicates-from-sorted-list,83.cpp
- 141-linked-list-cycle,141.cpp,題解:判斷單連結串列裡面有沒有環
- 160-intersection-of-two-linked-lists,160.cpp
- 203-remove-linked-list-elements,203.cpp
- 206-reverse-linked-list,206.cpp
- 234-palindrome-linked-list,234.cpp,題解:Palindrome Linked List 迴文連結串列 和 如何判斷一個單向連結串列是否為迴文連結串列(Palindrome Linked List)
(2) Array/Vector:
- 27-remove-element,27.cpp,參考:vector初始化
- 41-first-missing-positive,TBD
- 48-rotate-image,48.cpp
- 54-spiral-matrix,54.cpp,參考:C++ vector用法
- 59-spiral-matrix-ii,59.cpp,參考:動態建立二維vector陣列 C和C++ 及指標與引用的區別、vector動態建立陣列
- 88-merge-sorted-array,88.cpp
(3) Stack:
- 20-valid-parentheses,20.cpp
- 71-simplify-path,TBD
- 150-evaluate-reverse-polish-notation,150.cpp,參考:C++中int型與string型互相轉換
- 496-next-greater-element-i,496.cpp
- 844-backspace-string-compare,844.cpp,參考:C++ 將 std::string 轉換為 char*
(4) Tree:
- 94-binary-tree-inorder-traversal,94.cpp,參考:二叉樹的非遞迴遍歷
- 98-validate-binary-search-tree,98.cpp
- 100-same-tree,100.cpp
- 101-symmetric-tree,101.cpp
- 102-binary-tree-level-order-traversal,102.cpp,參考:vector的reserve和resize
- 103-binary-tree-zigzag-level-order-traversal,103.cpp
- 104-maximum-depth-of-binary-tree,104.cpp,參考:vector反轉reverse
- 105-construct-binary-tree-from-preorder-and-inorder-traversal,105.cpp,參考:STL裡Vector的assign()函式用法,已知前序(後序)遍歷序列和中序遍歷序列構建二叉樹(Leetcode相關題目)
- 106-construct-binary-tree-from-inorder-and-postorder-traversal,106.cpp
- 107-binary-tree-level-order-traversal-ii,107.cpp
- 112-path-sum,112.cpp
- 113-path-sum-ii,113.cpp
- 144-binary-tree-preorder-traversal,144.cpp
- 145-binary-tree-postorder-traversal,145.cpp
- 437-path-sum-iii,437.cpp
- 513-find-bottom-left-tree-value,513.cpp
- 515-find-largest-value-in-each-tree-row,515.cpp
- 617-merge-two-binary-trees,617.cpp
(5) String:
- 28-implement-strstr,28.cpp
- 58-length-of-last-word,58.cpp
- 67-add-binary,67.cpp
- 125-valid-palindrome,125.cpp
- 344-reverse-string,344.cpp
- 345-reverse-vowels-of-a-string,345.cpp
- 387-first-unique-character-in-a-string,387.cpp
- 434-number-of-segments-in-a-string,434.cpp
- 459-repeated-substring-pattern,459.cpp
- 520-detect-capital,520.cpp
- 680-valid-palindrome-ii,680.cpp,參考:LeetCode上遇到Runtime Error錯誤、Valid Palindrome II 驗證迴文字串之二
- 709-to-lower-case,709.cpp
- 819-most-common-word,819.cpp
(6) Sorting:
- 56-merge-intervals,56.cpp,參考:解決Line 26: invalid use of non-static member function,how-to-sort-an-stl-vector
- 57-insert-interval,57.cpp
- 75-sort-colors,75.cpp
- 147-insertion-sort-list,147.cpp
- 179-largest-number,179.cpp,參考:Easiest way to convert int to string in C++、Largest Number
- 242-valid-anagram,242.cpp,參考:C++中map的用法
- 349-intersection-of-two-arrays,349.cpp,參考:C++中set的用法