for(i = 0; i < n; i++)
{
j+=i;
}
Assuming that Big O for the above code is O(2n), what will be Θ ( tight bound ) and Ω (lower bound) for the above code?
for(i = 0; i < n; i++)
{
j+=i;
}
Assuming that Big O for the above code is O(2n), what will be Θ ( tight bound ) and Ω (lower bound) for the above code?
Theta O (tight bound) is the actual amount of computation done that will be O(n) and Omega O (lower bound) is also O(n) i.e the minimum computation required