mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
parent
8f468a9cd4
commit
f77fd6fb2d
@ -30,7 +30,7 @@ void graph::printgraph(){
|
|||||||
}
|
}
|
||||||
void graph::bfs(int s){
|
void graph::bfs(int s){
|
||||||
bool *visited = new bool[this->v+1];
|
bool *visited = new bool[this->v+1];
|
||||||
memset(visited,false,sizeof(visited));
|
memset(visited,false,sizeof(bool)*(this->v+1));
|
||||||
visited[s]=true;
|
visited[s]=true;
|
||||||
list<int> q;
|
list<int> q;
|
||||||
q.push_back(s);
|
q.push_back(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user