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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post 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 41 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply