Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

big o
time complexity
space complexity

Time complexity vs. space complexity

Educative Answers Team

There are multiple ways to design an algorithm, or considering which one to implement in an application. When thinking through this, it’s crucial to consider the algorithm’s time complexity and space complexity.

Time complexity

The time complexity of an algorithm is the amount of time taken by the algorithm to complete its process as a function of its input length, n. The time complexity of an algorithm is commonly expressed using asymptotic notations:

  • Big O - OO(n),
  • Big Theta - Θ\Theta(n)
  • Big Omega - Ω\Omega(n)