Question: ` ` ` PrimitiveIntBinarySearchTree.java 1 / / PROGRAMMER: John Doe / / CLASS: PrimitiveIntBinarySearchTreeNode / / / / CONSTRUCTORS / / PrimitiveIntBinarySearchTreeNode ( element: int
PrimitiveIntBinarySearchTree.java
PROGRAMMER: John Doe
CLASS: PrimitiveIntBinarySearchTreeNode
CONSTRUCTORS
PrimitiveIntBinarySearchTreeNodeelement: int
INSTANCE METHODS
getElement: int
getLeftChild: PrimitiveIntBinarySearchTreeNode
getRightChild: PrimitiveIntBinarySearchTreeNode
setLeftChildleftChild: PrimitiveIntBinarySearchTreeNode: void
setRightChildrightChild: PrimitiveIntBinarySearchTreeNode: void
public class PrimitiveIntBinarySearchTree
INSTANCE VARIABLES
private int size;
private PrimitiveIntBinarySearchTreeNode root;
CONSTRUCTORS
public PrimitiveIntBinarySearchTree
INSTANCE METHODS
public boolean insertint element refer to lesson notes
public int getSize
private PrimitiveIntBinarySearchTreeNode getParentint element refer to lesson notes
public void traverseString algorithm
switchalgorithm
case "InOrder":
traverseInrderroot;
break;
case "Prerder":
traversePrerderroot;
break;
case "Postrder":
traversePostrderroot;
break;
default:
System.out.printlnInvalid traversal algorithm";
Traverse output should be on only one line with a comma and space after each number
private void traverseInOrderPrimitiveIntBinarySearchTreeNode node
Traverse output should be on only one line with a comma and space after each number
private void traversePrerderPrimitiveIntBinarySearchTreeNode node
Traverse output should be on only one line with a comma and space after each number
private void traversePostOrderPrimitiveIntBinarySearchTreeNode node
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
