Big-O Notation Calculator

Paste a JavaScript snippet to get a rough heuristic estimate of its time complexity based on nested loops.

O(1) This is a highly simplified heuristic based on detecting keywords.

Complexity Cheat Sheet

Algorithm Time (Average) Space
Hash Table LookupO(1)O(N)
Binary SearchO(log N)O(1)
Linear SearchO(N)O(1)
Merge SortO(N log N)O(N)
Quick SortO(N log N)O(log N)
Bubble / Insertion SortO(N^2)O(1)

What is the Big-O Notation Calculator?

Paste a JavaScript snippet to get a rough heuristic estimate of its time complexity based on nested loops.