Question
Need help for three BinaryTree class public class BinaryTree { //Implements a Binary Tree of Strings private class Node { private Node left; private String
Need help for three BinaryTree class
public class BinaryTree {
//Implements a Binary Tree of Strings
private class Node {
private Node left;
private String data;
private Node right;
private Node parent; // reference to the parent node
// the parent is null for the root node
private Node(Node L, String d, Node r, Node p) {
left = L;
data = d;
right = r;
parent = p;
}
}
private Node root;
public BinaryTree() {
// create an empty tree
root = null;
}
public BinaryTree(String d) {
// create a tree with a single node
root = new Node(null, d, null, root);
}
public BinaryTree(BinaryTree b1, String d, BinaryTree b2) {
// merge the trees b1 AND b2 with a common root with data d
}
Step 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