Bfs checking function

In the bfs checking function, the map is created as
map<T,int>visited;
but later, its initialized with the bool values true/false.

Should the map be made as <T, bool> right? Or can int also take in bool values?

Hello @sonalbera it can also work for this because if the value is not 0 then the value will be couted as high and if the value is high then it will be evaluated as true.
but if the value is 0 then it will be evaluated as false.
if you have any doubt you can ask here:
HappyLearning!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.