Question: Draw the Binary Tree that is constructed by calling the following methods. BinaryTree T1; T1.addRoot(5); addLeft(T1.root(), 10); addRight(T1.root(), 15); BinaryTree T2; T2.addRoot(20); addLeft(T2.root(), 18); addRight(T2.root(),
Draw the Binary Tree that is constructed by calling the following methods.
BinaryTree T1;
T1.addRoot(5);
addLeft(T1.root(), 10);
addRight(T1.root(), 15);
BinaryTree T2;
T2.addRoot(20);
addLeft(T2.root(), 18);
addRight(T2.root(), 26);
BinaryTree T;
T.addRoot(8);
attach(T.root, T1, T2);
Upload an image showing the tree diagram or show it as following, make sure your result is clear enough to tell the left child or right child or parent node relation. Details regarding the used method can be found under content->others->binary tree code->linkedBinaryTree
1
2 3
5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
