Example #1
0
 private void agregarArco(cVertice pVerticeOrigen, cVertice pVerticeDestino, int pdistancia)
 {
     if (ExisteVertice(pVerticeOrigen))
     {
         if (aVertice.Equals(pVerticeOrigen))
         {
             //Agregar Arco
             if (!aLista.ExisteElemento(pVerticeDestino))
             {
                 aLista.Agregar(pVerticeDestino, pdistancia);
             }
         }
         else if (aSiguiente != null)
         {
             aSiguiente.agregarArco(pVerticeOrigen, pVerticeDestino, pdistancia);
         }
     }
 }
Example #2
0
 public void Agregar(cVertice pElemento, int pPeso)
 {
     if (pElemento != null)
     {
         if (aElemento == null)
         {
             aElemento = new cVertice(pElemento.nombre);
             aPeso     = pPeso;
             aSublista = new cLista();
         }
         else
         {
             if (!ExisteElemento(pElemento))
             {
                 aSublista.Agregar(pElemento, pPeso);
             }
         }
     }
 }