Page 1 of 1

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

Posted: Mon Jun 06, 2022 1:41 pm
by answerhappygod
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 1
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 1 (89.29 KiB) Viewed 42 times
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 + 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