How to add Big O and Big omega

If the algorithm has two sub-algorithms, when it is the best case for sub-algorithm A1 for a given input, this is the worst case for sub-algorithm A2. How can I find the overall complexity of the algorithm? I just mean Ω (N) + O (N) =? I know if the algorithms are executed sequentially, across the complexity of O (N) + O (N) and in the nested order of O (N) * O (N).

Please tell me in both cases, when in a sequential and nested order

+5
source share
2 answers

Essentially, Ω (N) + O (N) = Ω (N). Since O (N) means a lower (or nothing more) order Ω (N). When they are summed, the lower order can be omitted.

+5
source

, () O (N), , O (N ^ 2), O (N ^ 2). , O (N ^ 2 + N). Ω(). " ".

N , O (N), O (N ^ 2). Ω(). , N. " ".

+3

All Articles