0% found this document useful (0 votes)
28 views1 page

DSA Time Complexity Table

The document provides a table of various algorithms along with their best and worst-case time complexities. It includes a range of algorithms such as sorting, searching, and dynamic programming with their respective time complexities listed in Big O notation. This serves as a quick reference for understanding the efficiency of different algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

DSA Time Complexity Table

The document provides a table of various algorithms along with their best and worst-case time complexities. It includes a range of algorithms such as sorting, searching, and dynamic programming with their respective time complexities listed in Big O notation. This serves as a quick reference for understanding the efficiency of different algorithms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 1

ProblemBest Case Worst

Time Case Time


Loop DetecO(n) O(n)
Sort the Bi O(n) O(n)
Segregate O(n) O(n)
Merge sortO(n log n) O(n log n)
Minimum SO(1) O(1)
The CelebrO(n) O(n)
Iterative T O(2^n) O(2^n)
Stock SpanO(n) O(n)
Priority QuO(1) O(n)
Sort withouO(n log n) O(n log n)
Stack permO(n) O(n)
Recover thO(n) O(n)
Views of trO(n) O(n)
Vertical or O(n log n) O(n log n)
Boundary tO(n) O(n)
BFS, DFS O(V + E) O(V + E)
Dial's Algo O(V + E) O(W * V + E)
Bellman-FoO(VE) O(VE)
TopologicalO(V + E) O(V + E)
Heap Sort O(n log n) O(n log n)
Binomial hO(log n) O(log n)
K-ary heapO(logₖ n) O(logₖ n)
Winner treO(n) O(n)
HashMap tO(n log n) O(n log n)
Types of Se- -
Distribute O(n) O(n²)
Fibonacci (O(n) O(n)
Longest C O(mn) O(mn)
Longest In O(n log n) O(n²)
Longest Bi O(n²) O(n²)
Longest PaO(n²) O(n²)
Subset sumO(n*sum) O(n*sum)
0-1 KnapsaO(n*W) O(n*W)
Traveling O(n² * 2ⁿ) O(n² * 2ⁿ)
Coin ChangO(n*amounO(n*amount)
Shortest O(mn) O(mn)
LevenshteiO(mn) O(mn)
Rod Cuttin O(n²) O(n²)
Wildcard pO(mn) O(mn)
Pots of go O(n²) O(n²)

You might also like