Determine the frequency count of all statements in the following algorithm segment:
i:=1;
while(i<=n) do {
x:=x+1;
i:=i+1;} *
Answers
Answered by
10
Answer:
(i.e. the number of time each statement gets read/executed) in the following C code.
The frequency count of each statement must be written in terms of 'n'.
for(i=1;i<=n;i++)
for(j=1;j<=i;j++)
for(k=1;k<=j;k++)
x=x+1;
Answered by
1
Answer:
3n+2
Explanation:
1+(n+1)+n+n
Similar questions