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(); } } }
public object IesimoElemento(int posicion) { if ((posicion > 0) && (posicion <= NroElementos())) { if (posicion == 1) { return(aElemento); } else { return(aSublista.IesimoElemento(posicion - 1)); } } else { return(0); } }