//PASO 1. Falta eliminar los estados //nodo inicial //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public java.util.ArrayList<N> BFS(IGrafo<N> grafo, N n) throws Excepciones.ExcepcionNodoNoEncontrado public virtual List<N> BFS(IGrafo<N> grafo, N n) { grafo.reestablecerNodos(); if (grafo.existeNodo(n)) { LinkedList<N> cola = new LinkedList<N>(); cola.AddLast(n); grafo.buscarNodo(n).EstaVisitado = true; List<N> array = new List<N>(); while (cola.Count > 0) { N actual = cola.RemoveFirst(); array.Add(actual); List<N> aux = grafo.darAdyacentes(actual); for (int i = 0; i < aux.Count; i++) { N sig = aux[i]; if (grafo.buscarNodo(sig).EstaVisitado == false) { grafo.buscarNodo(sig).EstaVisitado = true; cola.AddLast(sig); } } } return array; } else { return null; } }