Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Big-O Cheat Sheet, Cheat Sheet of Data Structures and Algorithms

This cheat sheet presents the big-O notation for the insert, delete, and search operations of the data structures:

Typology: Cheat Sheet

2019/2020
On special offer
20 Points
Discount

Limited-time offer


Uploaded on 10/09/2020

ekaashaah
ekaashaah 🇺🇸

4.4

(38)

21 documents

Partial preview of the text

Download Big-O Cheat Sheet and more Cheat Sheet Data Structures and Algorithms in PDF only on Docsity! Big-O Cheat Sheet Generated December 10, 2013. Brandon Amos <http://bamos.github.io> 1 Searching Algorithm Data Structure Time Complexity Space Complexity Average Worst Depth First Search (DFS) Graph of |V | vertices and |E| edges - O (|E|+ |V |) O (|V |) Breadth First Search (BFS) Graph of |V | vertices and|E| edges - O (|E|+ |V |) O (|V |) Binary search Sorted array of n elements O (log(n)) O (log(n)) O (1) Linear (Brute Force) Array O (n) O (n) O (1) Shortest path by Dijkstra, using a Min-heap as prior- ity queue Graph with |V | vertices and |E| edges O ((|V |+ |E|) log |V |) O ((|V |+ |E|) log |V |) O (|V |) Shortest path by Dijkstra, using an unsorted array as priority queue Graph with |V | vertices and |E| edges O ( |V |2 ) O ( |V |2 ) O (|V |) Shortest path by Bellman- Ford Graph with |V | vertices and |E| edges O (|V ||E|) O (|V ||E|) O (|V |) 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved