Question: Suppose that the ADT binary tree has the operation replace(item: ItemType, replacementItem: ItemType): boolean It locates, if possible, the node in a binary tree that
Suppose that the ADT binary tree has the operation replace(item: ItemType, replacementItem: ItemType): boolean It locates, if possible, the node in a binary tree that contains item and replaces item with replacementItem .
a. Add the operation replace to the link-based implementation of the ADT binary tree given in this chapter. The operation should replace an item without altering the tree structure.
b. Add the operation replace to the link-based implementation of the ADT binary search tree. Be sure that the tree remains a binary search tree.
c. Implement a method replace within a client of BinarySearchTree .
I DONT NEED THE CODE I JUST NEED AN EXPLANATION OF THE CODE. ONLY AN EXPLANATION OF PART:A,B,C. An explanation of each one
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
