Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!)
Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!)
) @ericdrowell
Check out El Grapho, a graph data visualization library that supports millions
of nodes and edges
O(n!) O(2^n)
O(n^2)
O(n log n)
Operations
O(n)
Elements
https://www.bigocheatsheet.com 1/5
5/10/2021 Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!) @ericdrowell
receptix
OPEN
Social Media Marketing Jobs
Stack Θ(n) Θ(n) Θ(1) Θ(1) O(n) O(n) O(1) O(1) O(n)
Queue Θ(n) Θ(n) Θ(1) Θ(1) O(n) O(n) O(1) O(1) O(n)
Singly-Linked List Θ(n) Θ(n) Θ(1) Θ(1) O(n) O(n) O(1) O(1) O(n)
Doubly-Linked List Θ(n) Θ(n) Θ(1) Θ(1) O(n) O(n) O(1) O(1) O(n)
Skip List Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(n) O(n) O(n) O(n) O(n log(n))
Hash Table N/A Θ(1) Θ(1) Θ(1) N/A O(n) O(n) O(n) O(n)
Binary Search Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(n) O(n) O(n) O(n) O(n)
Cartesian Tree N/A Θ(log(n)) Θ(log(n)) Θ(log(n)) N/A O(n) O(n) O(n) O(n)
B-Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n)
Red-Black Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n)
Splay Tree N/A Θ(log(n)) Θ(log(n)) Θ(log(n)) N/A O(log(n)) O(log(n)) O(log(n)) O(n)
AVL Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(log(n)) O(log(n)) O(log(n)) O(log(n)) O(n)
KD Tree Θ(log(n)) Θ(log(n)) Θ(log(n)) Θ(log(n)) O(n) O(n) O(n) O(n) O(n)
Learn More
https://www.bigocheatsheet.com 2/5
5/10/2021 Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!) @ericdrowell
Contributors
Eric Rowell Quentin Pleple Michael Abed Nick Dizazzo Adam Forsyth Felix Zhu Jay Engineer
Josh Davis Nodir Turakulov Jennifer Hamon David Dorfman Bart Massey Ray Pereda Si Pham
Mike Davis mcverry Max Hoffmann Bahador Saket Damon Davison Alvin Wan Alan Briolat
Drew Hannay Andrew Rasmussen Dennis Tsang Vinnie Magro Adam Arold Alejandro Ramirez
Aneel Nazareth Rahul Chowdhury Jonathan McElroy steven41292 Brandon Amos Joel Friedly
Casper Van Gheluwe Eric Lefevre-Ardant Oleg Renfred Harper Piper Chester Miguel Amigot Apurva K
Matthew Daronco Yun-Cheng Lin Clay Tyler Orhan Can Ozalp Ayman Singh David Morton
Aurelien Ooms Sebastian Paaske Torholm Koushik Krishnan Drew Bailey Robert Burke
https://www.bigocheatsheet.com 3/5
5/10/2021 Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!) @ericdrowell
Sponsored
Susan Boyle Is Almost 60, Try Not To Smile When You See Her
Now
Half Eddie
LOG IN WITH
OR SIGN UP WITH DISQUS ?
Name
https://www.bigocheatsheet.com 4/5
5/10/2021 Big-O Algorithm Complexity Cheat Sheet (Know Thy Complexities!) @ericdrowell
Sponsored
https://www.bigocheatsheet.com 5/5