Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 hereStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started