Question: 1. insertProcedure (int a[], int p [], int N) 2. { 3. int i, j, k; 4. for (i=0; i

 1. insertProcedure (int a[], int p [], int N) 2. { 3. int i, j, k; 4. for (i=0; i<=N; i++) 5. p[i] = i; 6. for (i=2; i<=N; i++) 7. { 8. k = p[i]; 9. j = 1; 10. while (a[p[j-1]] > a[k]) 11. { 12. p[j] = p[j-1]; 13. j--; 14. } // end while 15. p[j] = k; 16. } // end for 17. } // end insertProcedure 

Use the method above to answer the following questions.

Draw the control flow graph. To simplify grading, use the line numbers for node numbers. For example, the node that represents the while statement should be node 10. (You will not need all the numbers.)

Give Reach (6), the set of reachable nodes from node 6.

Give one path that is not a test path.

Give one test path that is not a prime path.

List the edge-pair coverage test requirements for the graph. You do not need to list TRs that are less than length 2, unless they are not part of a longer TR.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!