I have the AVLNode and AVLTree classes, i have the methods to remove and insert nodes and i have a print method. I want to use these methods to create a AVL tree. On input i want to write "Add x" and "Remove x". I wrote this but when i print nothing shows
public static void main(String[] args) throws IOException {
int i;
BufferedReader scanner = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(scanner.readLine());
String[] words = new String[n];
AVLTree<Integer> t = new AVLTree<Integer>();
for (i = 0; i < n; i++) {
String splitn = scanner.readLine();
words[i] = (splitn.split(" ")[0]);
int M = Integer.parseInt(splitn.split(" ")[1]);
if (words[i] == "Add") {
t.insert(M);
}
if (words[i] == "Remove") {
t.remove(M);
}
}
t.print();
}