72.0k views
2 votes
If the three operations were combined, O(logN) + O(N) * O(logN) + 1, the overall algorithm cost would be:________

A. O(N)
B. O(logN)
C. O(logN)+O(N)
D. O(NlogN)

User Lubgr
by
4.9k points

2 Answers

4 votes

Answer:

D. O(NlogN)

Step-by-step explanation:

the overall algorithm cost would be: O(NlogN).

User Easyjo
by
4.3k points
0 votes

Answer:

D. O(NlogN)

Step-by-step explanation:

The computation of the overall algorithm cost is as follows:

Given that

O(logN) + O(N) × O(logN) + 1

In the case of complexity we considered the high order that dominates the other terms

Thus, that term would be

O(N) × O(logN)

It could be rewrite as

O(NlogN)

Hence, the correct option is D.

All the other options are wrong

User Glebcom
by
4.3k points