import java.util.*;
public class TakeInput {
public static Tree_Node<Integer> takeInput() {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt(); //this is for root
Tree_Node<Integer> root = new Tree_Node<Integer>(n);
int childNode = scan.nextInt();
for(int i =0; i < childNode; i++){
Tree_Node<Integer> child= takeInput();
root.children.add(child);
}
return root;
}
public static void main(String[] args) {
takeInput();
}
}
Comments
Post a Comment