How can I implement a tree that saves the father and the list of children in java I have done the following class to store the states. Is there a simple way to fill in the nodes with the possible states of the game 8-Puzzle?
public class Nodo {
int value_FuncionF;
int value_heuristica_H; // numero de casillas fuera de lugar
int value_heuristica_costoG; //Cuato ha costado llegar a este nodo
Nodo padre= null;
private List<Nodo> hijos = null;
String estado[][] = null;
public Nodo() {}
public Nodo(String nuevoEstado[][]) {
this.estado = nuevoEstado;
}
public int getF() {
return value_FuncionF;
}
}