algorithm analysis

Why do we use the tightest Big O bound?

If an algorithm runs in O(n), then O(n²), O(n³), and even O(n!) are technically valid upper bounds too. So why do people expect the smallest or tightest bound…

Is this function O(n) or O(1)?

I have a debate going on with my professor about the time complexity of a function I've written. The code is as follows: ```cpp int f(int m, int…

Is O(c^(k+1)) the same as O(c^k)?

I'm working on a project related to the Hitting Set problem, which involves exponential algorithms, and I stumbled upon a question: Are O(c^(k+1)) and O(c^k) equivalent? Just like…