Question: 3. The following function is to exchange the left and right sub-tree of a binary tree which is stored in a chain structure, please

3. The following function is to exchange the left and right sub-tree 

3. The following function is to exchange the left and right sub-tree of a binary tree which is stored in a chain structure, please complete the function. typedef struct BTNode { char data; struct BTNode *Ichild; struct BTNode*rchild; } *BiTree; BiTree swap(BiTree b) { } BiTree t, tl, t2; if (b== NULL)_(1)____; else { t = (BiTree) malloc(sizeof(BTNode)); t->data t1 = t2 = = (3); (4)___ ; t->lchild = 12; _(5)_ = tl; } return(t); (2)____;

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 Algorithms Questions!