if(faster==head||faster->next=
=head)
return slower
else
faster=faster->next->next
slower=slower->next
HERE we hv three poniter faster,headr,slower.
as u hv mentioned that linked list has cycle list so better is that we hv
to use for loop
as :-
if we take headr,link,temp;
if(temp==headr)
{
link->temp=first;
}
else
return temp;
for(temp->first=null;temp>headr;temp->link++)
{
we can print the middle element;
}
or inplace of this we can use the pointer concept to assign the middle and
faster element..........
--
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.