Question: Consider the following code segment: (1) Total = 0; (2) for(x = 0; x < mNum; x++) { (3) for(y = 0; y < mNum*mNum;
Consider the following code segment: (1) Total = 0; (2) for(x = 0; x < mNum; x++) { (3) for(y = 0; y < mNum*mNum; y++){ (4) Total++; } } Give the big-O estimate of the above segment, and of each step. Be sure to explain how you arrived at your estimates. Answer format: (1) O(_) -- Explanation (2) O(_) -- Explanation (3) O(_) -- Explanation (4) O(_) -- Explanation Total time: (Show any arithmetic if necessary) = O(_)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
