Question: Consider the following Deletemin ( ) function in binary heaps. The numbers at the left hand side specify each a node ( i . e

Consider the following Deletemin() function in binary heaps. The numbers at the left hand side specify each a node (i.e., a control node or a regular node) in the control flow graph.if isEmpty(h){display("queue empty"); return (h->elements[0]); }minelm =h->elements [1]; lastelm =h->elements[h->size--];for (i=1;i**2=h-> size; i= chld ){// find smaller childchild =i^(**)2;if (chld !=h->size &&h->elements[chld +1] h->elements[chld])chld++;// percolate one levelif ( lastelm > h-> elements[chld])h->elements[i]= h->elements[chld];else break; }h->elements [i]= lastelm;// restore min-heap property if violatedfor (j=i;hrarr >elements [j//2]> lastelm; j//=2)h rarr elements [j]=h-> elements [j//2];}h->elements [j]= lastelm; return minelm;a)(15 pts)Draw the control flow graph of the algorithm above! Your graph may contain only 14 nodes and the B and E nodes to denote the "begin" and "end" of the flow. Please use the numbers to mark the nodes (NOT the code!!!) in the flow graph!b)(5 pts)Calculate the computational complexity (CC) of the flow graph!c)(10 pts)List all independent paths!d)(10 pts)What independent paths are the following dependent paths composed of?B 1345678101112111314EB 134567894101112111314Ee)(5+5+5=15pts)What is the statement coverage for each of the following test cases?elements [1,dots,8]larr{11,21,16,31,41,61,71,51}elements larr empty;both of the two above cases together;f)(5+5+5=15pts)What is the edge coverage for the three cases above in part (e)?2 out of 5
 Consider the following Deletemin() function in binary heaps. The numbers at

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!