Question: 4. The given programming code shown in figure 3 is written to perform the binary tree insert function. By using the following code, answer the

4. The given programming code shown in figure 3 is written to perform the binary tree "insert" function. By using the following code, answer the following question: a) Transfer the graph below into data flow annotations. [8 marks] b) Is the graph represent the correct flow of the software? If no, please redraw the correct graph and justify your answers. [8 marks] 1.4 5-7 1 void btree::insert(tnode*&ptr,int item) 2 { 3 if (ptr==NULL) 4 { 5 ptr=new tnode; 6 if(ptr==NULL) 7 { 8 coutright=NULL; ptr->left=NULL; 1 ptr-Sitem=item; 8-10 11.16 17 -06-o-rece 1 } else 18-20 1 1 { if (item
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
