Forráskód Böngészése

Replace stack by queue in bfs

DricomDragon 5 éve
szülő
commit
7756e5715a
1 módosított fájl, 2 hozzáadás és 2 törlés
  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);