Big O Notation
Last updated
What is Big O Notation?
"Big O" notation, officially known as O-notation, is used in computer science to describe the performance or complexity of an algorithm. Specifically, it provides an upper bound on the time complexity, describing the worst-case scenario. Thus, it gives an upper limit on the time taken for an algorithm to complete based on the size of the input. The notation is expressed as O(f(n)), where f(n) is a function that measures the largest count of steps that an algorithm could possibly take to solve a problem of size n. For instance, O(n) denotes a linear relationship between the time taken and the input size, while O(1) signifies constant time complexity, i.e., the time taken is independent of input size. Remember, Big O notation is only an approximation meant to describe the scaling of the algorithm and not the exact time taken.
Free resources to learn Big O Notation
More in stage 6: Algorithmic Complexity
Big O Notation: common questions
Can I learn Big O Notation in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Big O Notation in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Big O Notation tutorial for beginners?
It is lesson 28 of 107 in the free Data Structures & Algorithms roadmap, in stage 6, Algorithmic Complexity. If you are new to Data Structures & Algorithms, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.