Answered step by step
Verified Expert Solution
Link Copied!

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 =

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions