Sir, i have a doubt in a code

at 7:12, in line 111. Sir, apn ye if loop q lga rhe hain ? ->
if(!q,empty()){ q.push(NULL);}

this is not a loop
it’s if condition

we are checking this so that we don’t stuck in infinite loop

we have to push NULL only if q is not empty
if q is empty and we again push NULL
then every time we pop null print endl and again push NULL
in this way loop runs infinitely

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.