Question: EXISTING CODE class BinarySearchTree: def __init__(self, data, left=None, right=None): self.data = data self.left = left self.right = right def get_left(self): return self.left def get_right(self): return
EXISTING CODE
class BinarySearchTree: def __init__(self, data, left=None, right=None): self.data = data self.left = left self.right = right def get_left(self): return self.left def get_right(self): return self.right def set_data(self, data): self.data = data def get_data(self): return self.data def set_left(self, left): self.left = left def set_right(self, right): self.right = right
An implementation of the BinarySearchTree ADT is shown in the answer box for this question. Extend the BinarySearchTree class by adding the method find_in_order_successor_self) which takes no parameter. This method should search for the in-order successor of the node and return it. The inorder successor is the leftmost node in the right subtree. If there is no right subtree, the function returns the node itself. Note: Submit the entire class definition. For example: Answer: (penalty regime: 0,0,5,10,15,20,25,30,35,40,45,50% )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
