Explorar el Código

Replace stack by queue in bfs

DricomDragon hace 5 años
padre
commit
7756e5715a
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      main.cc

+ 2 - 2
main.cc

@@ -255,7 +255,7 @@ class World
 			explored[origin] = true;
 
 
-			stack<unsigned int> open;
+			queue<unsigned int> open;
 			open.push(origin);
 
 			int current;
@@ -264,7 +264,7 @@ class World
 			unsigned int nbSuccs;
 
 			do {
-				current = open.top();
+				current = open.front();
 				open.pop();
 
 				nbSuccs = successors(current, succs);