-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
executable file
·33 lines (32 loc) · 1.11 KB
/
Main.java
File metadata and controls
executable file
·33 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
//main class only for testing program
public class Main {
//main mrthod
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Menu");
System.out.println("1 Binary Search Tree");
System.out.println("(any) Balanced Binary Search Tree");
System.out.print("Choice : ");
if(scan.nextInt()==1){
PersistentDynamic tree = new PersistentDynamic();
System.out.println("Enter Comma Seprated numbers: ");
scan.nextLine();
String[] data = scan.nextLine().split(",");
for(String input: data){
tree.add(input.trim());
}
tree.display();
}
else{
BalancedPersistentDynamic tree = new BalancedPersistentDynamic();
System.out.println("Enter Comma Seprated numbers: ");
scan.nextLine();
String[] data = scan.nextLine().split(",");
for(String input: data){
tree.add(input.trim());
}
tree.display();
}
}
}