WE have to add the printPostorder() method into the BinarySearchTree1 class. As
ID: 3757417 • Letter: W
Question
WE have to add the printPostorder() method into the BinarySearchTree1 class. As shown below.
public class BinarySearchTreeNode
{
public int key;
public BinarySearchTreeNode left;
public BinarySearchTreeNode right;
}
public class BinarySearchTree1
{
private BinartSearchTreeNode root;
public void insert(int key){}
public void delete(int key){}
public void find(int key){}
Explanation / Answer
void printPostorder(BinarySearchTreeNode root)
{
if(root==null)
return;
printPostOrder(root.left);
printPostorder(root.right);
System.out.print(root.key + " ");
}
public void printPostorder()
{
printPostorder(root);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.