LeetCode Summary of Data Structure & Algorithms

來源:互聯網
上載者:User


1. 常見資料結構

線性:
數組:Merge Sorted Array
鏈表:Merge k Sorted Lists,Partition List
隊列,
堆棧,
塊狀數組(數組+鏈表),
hash表,
雙端隊列,
位元影像(bitmap)

樹:
   二叉樹: Minimum Depth of Binary Tree, Path Sum II, Inorder Travel
堆(大頂堆、小頂堆),
trie樹(字母樹or字典樹),
尾碼樹,
尾碼樹組,
二叉排序/尋找樹,
B+/B-,
AVL樹,
Treap,
紅/黑樹狀結構,
splay樹,
線段樹,
樹狀數組

圖:圖

其它:並查集

2、常見演算法

(1) 基本思想:枚舉,
遞迴: Flatten Binary Tree to Linked List,Generate Parentheses,Letter Combinations of a Phone Number
分治,
類比&貪心: Gray Code,Insert Interval,Jump Game II, Multiply Strings, Next Permutation, Palindrome Number,Pascal's Triangle II
貪心,動態規劃,剪枝,回溯
二分尋找:Median of Two Sorted Arrays,Search in Rotated Sorted Array

(2) 圖演算法:深度優先遍曆與廣度優先遍曆, 最短路徑,最小產生樹,拓撲排序

(3) 字串演算法:
字串尋找: Implement strStr,Length Of Last Word,Longest Common Prefix,
Longest Palindromic Substring, Longest Non-Repeating SubString
雙指標: Minimum Window Substring
hash演算法,KMP演算法

(4) 排序演算法:冒泡,插入,選擇,快排,歸併排序,堆排序,
桶排序: First Missing Positive

(5) 動態規劃:Distinct Subsequences,Edit Distance, Interleaving String, Jump Game,Largest Rectangle in Histogram
背包問題,最長公用子序列,最優二分檢索樹

(6) 數論問題:素數問題,整數問題,進位轉換,同餘模運算,
進位轉換:Integer To Roman
乘除法:Divide Two Integers

(7) 排列組合:排列和組合演算法

(8) 其它:LCA與RMQ問題

(9) 水箱問題:Trapping Rain Water,Container With Most Water,

 

3. 常見設計題
(1)海量資料處理


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.