p=head;
q=head->next; count=0;
while(p!=NULL && q!=NULL)
{ if(p==q)
{ //Loop detected! exit(0); }
p=p->next; count ++;
q=(q->next)?(q->next->next):q->next;
}
On Tue, Aug 23, 2011 at 11:35 PM, aayush jain <[email protected]> wrote:
> and anyone tell me exact code....
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
Aditi Garg
Undergraduate Student
Electronics & Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.