Question: ****python**** a) Draw a binary tree structure created by the following code fragment: a = BinaryTree(77) a.insert_left(53) a.insert_right(9) x = a.get_left() x.insert_left(33) x.insert_right(56) y =
****python****
a) Draw a binary tree structure created by the following code fragment:
a = BinaryTree(77)
a.insert_left(53)
a.insert_right(9)
x = a.get_left()
x.insert_left(33)
x.insert_right(56)
y = a.get_right()
y.insert_left(59)
y.insert_right(32)
b) What is the nested list representation of the binary tree?
c) What is the output if we print the tree vertically?
d) Write the pre-order, in-order and post-order traversal of the above binary tree. Include a brief explanation of the steps.
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
