Solved

Given the BinarySearchTree Class Discussed in Section 17

Question 76

Multiple Choice

Given the BinarySearchTree class discussed in section 17.3 (partially shown below) , select a sequence of statements to complete the recursive postorder method. The method performs a postorder traversal of the binary search tree rooted at node n. public class BinarySearchTree
{
Private Node root;
Public BinarySearchTree() {...}
Public void postorderTraversal()
{
Postorder(root) ;
}
Private static void postorder(Node n)
{
If (n != null)
{
____________________
____________________
____________________
}
}
) . .
}


A) postorder(n.right) ;
Postorder(n.left) ;
System.out.print(n.data + " ") ;
B) postorder(n.left) ;
Postorder(n.right) ;
System.out.print(n.data + " ") ;
C) postorder(n.left) ;
System.out.print(n.data + " ") ;
Postorder(n.right) ;
D) postorder(n.right) ;
System.out.print(n.data + " ") ;
Postorder(n.left) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents