Code cleanup (#4246)

This commit is contained in:
HManiac74
2023-07-22 17:23:00 +02:00
committed by GitHub
parent 3facb0d862
commit 2488a2ad51
52 changed files with 50 additions and 167 deletions

View File

@ -23,8 +23,6 @@ public class GenericTree {
}
private Node root;
private int size;
public GenericTree() { // Constructor
Scanner scn = new Scanner(System.in);
root = create_treeG(null, 0, scn);
@ -44,7 +42,6 @@ public class GenericTree {
int number = scn.nextInt();
for (int i = 0; i < number; i++) {
Node child = create_treeG(node, i, scn);
size++;
node.child.add(child);
}
return node;

View File

@ -30,11 +30,6 @@ public class TreeRandomNode {
int item;
Node left, right;
public Node(int key) {
item = key;
left = right = null;
}
}
// Using an arraylist to store the inorder traversal of the given binary tree

View File

@ -12,6 +12,7 @@ class Main {
int inputX0 = sc.nextInt();
int toPrint = nearestRightKey(root, inputX0);
System.out.println("Key: " + toPrint);
sc.close();
}
public static NRKTree BuildTree() {