Question

3. For each of the following program fragments: [18] a. Give an analysis of the running time (Big O will do) b. Implement the code in the language of your choice,

and give the running time for several values of N. c. Compare your analysis with the actual running times. 1. sum = 0; for (i = ++sum; 2. sum = 0; 0; i