Q:

(Add new buttons in BSTAnimation) Modify Listing 25.9, BSTAnimation.java, to add three new buttons—Show Inorder, Show Preorder, and Show Postorder— to display the result in a label, as shown in Figure 25.24

0

 (Add new buttons in BSTAnimation) Modify Listing 25.9, BSTAnimation.java, to add three new buttons—Show Inorder, Show Preorder, and Show Postorder— to display the result in a label, as shown in Figure  25.24. You need also to modify BST.java to implement the inorderList(), preorderList(), and postorderList() methods so that each of these methods returns a List of the node elements in inorder, preorder, and postorder, as follows:

 

public java.util.List<E> inorderList();
public java.util.List<E> preorderList();
public java.util.List<E> postorderList();

FIGURE 25.24 When you click the Show Inorder, Show Preorder, or Show Postorder button, the elements are displayed in an inorder, preorder, or postorder in a label. 

All Answers

total answers (0)

Similar questions


need a help?


find thousands of online teachers now