每個程序員都應(yīng)該收藏的算法復(fù)雜度速查表
算法復(fù)雜度這件事
這篇文章覆蓋了計算機(jī)科學(xué)里面常見算法的時間和空間的大O(Big-O)復(fù)雜度疆拘。我之前在參加面試前宪郊,經(jīng)常需要花費很多時間從互聯(lián)網(wǎng)上查找各種搜索和排序算法的優(yōu)劣软吐,以便我在面試時不會被問住膘盖。最近這幾年鞋拟,我面試了幾家硅谷的初創(chuàng)企業(yè)和一些更大一些的公司,如 Yahoo蚌父、eBay哮兰、LinkedIn 和 Google,每次我都需要準(zhǔn)備這個梢什,我就在問自己奠蹬,“為什么沒有人創(chuàng)建一個漂亮的大 O 速查表呢?”所以嗡午,為了節(jié)省大家的時間囤躁,我就創(chuàng)建了這個,希望你喜歡荔睹!
圖例
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A6.png)
數(shù)據(jù)結(jié)構(gòu)操作
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A63.png)
數(shù)組排序算法
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A64.png)
圖操作
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A65.png)
堆操作
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E5%A0%86%E6%93%8D%E4%BD%9C.png)
大O復(fù)雜度圖表
![](https://alleniverson.gitbooks.io/data-structure-and-algorithms/content/%E7%AE%97%E6%B3%95/images/%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E5%BA%A62.png)