Question: python Use the following code to represent a node of a Binary Tree: class Node: def init _(self, value): self.value = value self. left =

python
Use the following code to represent a node of a Binary Tree: class Node: def init _(self, value): self.value = value self. left = None self.right = None 1. Create a class BST and write the following functions: a. Write a function AddElement which takes a parameter value and insert a new node in the Binary Search Tree with the given value. (don't return or print anything) class BST : def init (self): self.root = None def AddElement (self, value) : // your code goes here b. Write a function FindElement which takes a parameter value and returns the node (not the value) with same value, otherwise returns None. def FindElement(self, value): // your code goes here C. Write a function Height that takes a parameter node and returns height of the node def Height (self, node): // your code goes here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
