Determine the complexity class () of the following pseudocode in the worst case. There could be one or more correct answ
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Determine the complexity class () of the following pseudocode in the worst case. There could be one or more correct answ
Determine the complexity class () of the following pseudocode in the worst case. There could be one or more correct answers. All variables are integers. Suppose that "random(a,b)" generates a random integer between a and b in O(1) time. i=1 s = 0 while i <= 2n for j = 1 to n s += random(1, 10) i = 2*i print(s) ###### □ (n²) ☐ 0 (2¹) □ (n2") (n log(n)) (n² log(n)) (2¹ log(n)) All are incorrect #######
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!