Qual é a complexidade assintótica do código a seguir?

int i, j, k = 0;
for (i = 0; i <= n; i++) {
for (j = 2; j <= n; j = j * 2) {
k = k + n / 2;
}
}


a.
O(n log₂ n)


b.
O(n²)


c.
O( n )

d.
O(log₂ n)


e.
O(n² log₂ n)
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 ELIBRARY.TIPS - All rights reserved.