Question: 1. insertProcedure (int a[], int p [], int N) 2. { 3. int i, j, k; 4. for (i=0; i a[k]) 11. { 12. p[j]
1. insertProcedure (int a[], int p [], int N) 2. { 3. int i, j, k; 4. for (i=0; i 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.)
Example: on how to define the following simple graph using the E, N0 and Nf:
![1. insertProcedure (int a[], int p [], int N) 2. {](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f30977cc961_70366f30977c856c.jpg)
N={ 1,2,3,4 }
N0={ 1 }
Nf={ 4 }
E={ (1,2) , (1,3) , (2,4) , (3,4) }
Where N0 is Initial nodes, Nf is the final node and E is the edges.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
