public int IesimoElementoPeso(int posicion) { if ((posicion > 0) && (posicion <= NroElementos())) { if (posicion == 1) { return(aPeso); } else { return(aSublista.IesimoElementoPeso(posicion - 1)); } } else { return(0); } }
public void MostrarGrafo() { if (aVertice != null) { for (int i = 1; i <= aLista.NroElementos(); i++) { Console.WriteLine(aVertice.nombre + "==> " + aLista.IesimoElemento(i) + "Con peso==> (" + aLista.IesimoElementoPeso(i) + " )"); aSiguiente.MostrarGrafo(); } } }