Question: public class BinaryTreeNode { private int item; private BinaryTreeNode parent, left, right; public BinaryTreeNode(int item, BinaryTreeNode parent, BinaryTreeNode left, BinaryTreeNode right) { this.item = item;

public class BinaryTreeNode { private int item; private BinaryTreeNode parent, left, right; public BinaryTreeNode(int item, BinaryTreeNode parent, BinaryTreeNode left, BinaryTreeNode right) { this.item = item; this.parent = parent; this.left = left; this.right = right; } public int getItem() { return item; } public BinaryTreeNode getParent() { return parent; } public BinaryTreeNode getLeft() { return left; } public BinaryTreeNode getRight() { return right; } public void setItem(int item) { this.item = item; } public void setParent(BinaryTreeNode parent) { this.parent = parent; } public void setLeft(BinaryTreeNode left) { this.left = left; } public void setRight(BinaryTreeNode right) { this.right = right; } }
----------------------------other class-------------------------- public class BinarySearchTree { private int size; private BinaryTreeNode root; public BinarySearchTree() { this.root = null; this.size = 0; } public BinaryTreeNode getRoot() { return this.root; } public int getSize() { return this.size; } /** * Deletes a Node containing the given integer. If the Node has 2 children, replaces with the Node of the minimum * value in the right child of the node. If the data is not present, returns null. * @param data The integer to be removed * @return The Node containing the integer to remove or null if one is not found */ public BinaryTreeNode remove(int data) { // TODO } /** * Deletes a Node containing the given integer. If the Node has 2 children, replaces with the Node of the maximum * value in the left child of the node. If the data is not present, returns null. * @param data The integer to be removed * @param curNode The current Node in the traversal * @return The Node containing the integer to remove or null if one is not found */ private BinaryTreeNode remove(int data, BinaryTreeNode curNode) { // TODO }

Please solve TODO and these two classes all I have.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!