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

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

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)