Question: (20marks) QUESTION 2 Consider the code below: struct tree struct tree left: int data; struct tree right: void insert_node (struct tree **tpp, int val *tpp

 (20marks) QUESTION 2 Consider the code below: struct tree struct tree
left: int data; struct tree right: void insert_node (struct tree **tpp, int
val *tpp (struct tree) malloc (sizeof (struct tree)) (*tpp)->data = val ;
(*tpp)->left-o: *tpp)-right-0 ) else f if (val data)( insert_node (& ((*tpp)->left),val); else

(20marks) QUESTION 2 Consider the code below: struct tree struct tree left: int data; struct tree right: void insert_node (struct tree **tpp, int val *tpp (struct tree) malloc (sizeof (struct tree)) (*tpp)->data = val ; (*tpp)->left-o: *tpp)-right-0 ) else f if (val data)( insert_node (& ((*tpp)->left),val); else insert node (& *tpp)->right), val): void inorder (struct tree* tp, int* array, int *np) ( if (tp-0) (return; ) inorder (tp->left, array, array[*np] = tp->data; np): inorder (tp->right, array, np); int main0 int i,n-0; struct tree* treeptr-0

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!