Question: Consider the following program segment: /* sort takes an integer array and sorts it in ascending order*/ 1. void sort (int a [ ], int
Consider the following program segment:
/* sort takes an integer array and sorts it in ascending order*/
1. void sort (int a [ ], int n) {
2. int i, j;
3. for(i=0;i 4. for(i=i+1;j 5. if(a[i]>a[j]) 6. { 7. temp=a[i]; 8. a[i]=a[j]; 9. a[j]=temp; 10. } 11. } (a) Draw the program graph for this program segment. (b) Determine the cyclomatic complexity for this program (show the intermediate steps of your computation). (c) How is the cyclomatic complexity metric useful?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
