The next question apply to the following code fragment: for i in 1..N loop for j in 1..i loop for k in i..j loop Sum Sum
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
The next question apply to the following code fragment: for i in 1..N loop for j in 1..i loop for k in i..j loop Sum Sum
question apply to the following code fragment: for i in 1..N loop for j in 1..i loop for k in i..j loop Sum Sum + 1; end loop; end loop; end loop; 8 for p in 1..N*N loop 9 for q in 1..p loop 10 Sum = Sum - 1; 11 end loop; 12 end loop; Q: How many times is statement 9 executed? a) O(N) b) O(N²) c) O(N³) d) O(N4) e) none of the above 123 557 00 0 4 6
The next