Question: Question: 4 a. Consider the following code in C. The function Functionl is called from the main function which receives root of a binary search

Question: 4 a. Consider the following code in C. The function Functionl is called from the main function which receives root of a binary search tree and the height function used in Functionl calculates the height of the tree. Function2 is called recursively and from Functionl. Now determine the output of the following BST using the below code. Functionl (tree) 1.for d = 1 to height(tree) +1 1.1. Function2 (tree, d); Function2 (tree, level) 1.if tree is NULL then return; 6 22 2.if level is 1, then 2.1 print (tree->data); 20 3.else if level greater than 1, then 3.1 Function2 (tree->left, level-1); 3.2 Function2(tree->right, level-1); // Call the function from main function Function1 (root)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
