Is there an way to calculate the value of O(n) (Big Oh)? I understand it's use in algorithm. But my question is how is the value calculated?
2026-04-13 14:03:40.1776089020
On
Is there an way to calculate the value of O(n)
63 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
2
On
The Landau symbol $O(n)$ in a formula, like the appearance you're pointing to in a comment, is not something you can calculate.
Rather, $O(n)$ is a placeholder for "here is something that we're not bothering to specify explicitly, but we will tell you that it grows no faster than $n$ does, or at most some fixed constant times $n$".
So an expression involving $O(\cdots)$ gives only partial information about the function it describes; it does not contain enough information to compute its exact value.
$O(n)$ is the set of all functions $f$ satisfying $|f(n)|\leq C|n|$ for some constant $C>0$ and all $n$ greater than some $N$.
Being that it is a set of functions, it does not have a "value", nor does it make sense to "compute" it.
Addendum: perhaps you are asking the following: how do I count the work done in an algorithm? This might be better suited for cstheory.stackexchange.com. You might also have a crack at reading this answer.