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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started