queue<node*> q
i didnt understand this line what does this signify?
Binary tree BFS travesal
this means we are making queue of type node* named q
node* means it holds addresses of node
so what u mean is q is the name of queue and it will contain adress pf the node?
yes exactly
you have to give some name here we give q
it is same as vector in vector we also give name
vector<int> v;
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like : and don’t forgot to mark doubt as resolved
but sir said we cant also make it of type node simply that is queue q but i am getting error when i do it here https://ide.codingblocks.com/s/298810
here making queue of type node is not possible
q.push(root->data);
this is wrong because root->data is not of the type node it is int
also if we assume data of type node is inside queue
then to print it we have to use dot
cout<<f.data<<" "<<endl;