1.For each of the following six program fragments:Give an analysis of the running time(Big-Oh will do)
(1) sum = 0;
for (i=0;i<N;i++)
sum++;
答:O( N )
(2) sum = 0;
for (i=0;i<N;i++)
for(j=0;j<N;j++)
sum++;
答:O(