fast->next->next will u plzz explain it by diagram
Fast->next->next will u plzz explain it by diagram
consider
1->2->3
fast is at 1 suppose
what is the next of fast?
it is a pointer pointing to 2
so let’s break it down
assume temp = fast->next
so by above explanation, i can say that temp points to 2
now in the next step we do
fast = temp->next
what does this do?
temp points at 2
and temp’s next points at 3
so now fast points at 3
therefore
by breaking down fast->next->next into two steps
fast now reaches 2 steps ahead
fast starts at head
and in condition we use && instead of ||
@Aditya-Kushwaha-914550392281281 if your doubt is solved, mark it as resolved
What is the problem they you are facing
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.