DEV Community

Ryan Heo
Ryan Heo

Posted on

[Algorithm] Big O

Time Complexity

Big O

  1. Best case scenario (Omega)
  2. Average case scenario (theta)
  3. Worst case scenario (O)

We always talk about the worst case, Big O.

1. O(n)

Proportional Graph
Drop Constants

2. O(n^2)

Exponential Graph
Drop Non-dominant

3. O(1)

Flat Graph

4. O(log(n))

Efficient than O(n) and O(n^2)
Quite Flat

5. O(n log(n))

Some Sorting Algorithm

Top comments (0)