/*
  Implement the preorder method in BST using a stack instead of recursion.
  Write a test program that prompts the user to enter 10 integers, stores them
  in a BST, and invokes the preorder method to display the elements.
*/

public class E25_04 {
  public static void main(String[] args) {
    Integer[] list = {10, 2, 4, 15, 13, 17, 1};
    BST<Integer> tree = new BST<>(list);
    tree.preorder();
    System.out.println();
  }
}

@@ -223,16 +223,43 @@
 ts.%0A*/%0A%0A
+import java.util.Scanner;%0A%0A
 public c
@@ -323,51 +323,214 @@
     
-Integer%5B%5D list = %7B10, 2, 4, 15, 13, 17, 1%7D;
+Scanner input = new Scanner(System.in);%0A    System.out.print(%22Enter 10 integers: %22);%0A    Integer%5B%5D list = new Integer%5B10%5D;%0A    for (int i = 0; i %3C list.length; i++) %7B%0A      list%5Bi%5D = input.nextInt();%0A    %7D%0A
 %0A   
@@ -592,34 +592,8 @@
 ();%0A
-    System.out.println();%0A
   %7D%0A

Add user input functionality