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. {

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

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!