Here fast!=NULL && fast->next!=NULL
why is this && condition?
it should be || ?
Midpoint LL doubt
Had we used || the returned value would be true as soon as fast is found not to be NULL, the computer wont even care about fast->next. Logical AND and OR expression chains are evaluated from left to right, and if the first subexpression satisfies the condition, no further subexpressions are evaluated.
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.