Conta filhos Node
public int contaFilhosNodo(GeneralTree t){ int contador = t.degree; return this.countNodes(t, contador); } private int countNodes(GeneralTree t, int c){ Node current = t.list.getFirst(); while(current!= null){ c = c + this.countNodes((GeneralTree) current.getData(),((GeneralTree) current.getData()).degree); current = current.getNext(); } return c; }
Ricardo
Curtidas 0