quest: find midlle element of a linked list in one traversal.
I have one soln. but i dnt think that goes in one traversal
it is
first=list;
sec=list;
while(sec->next != NULL)
{
first=first->next;
sec=sec->next->next;
}
cout<<first->val;

As when we are checking sec->next we are accessing linked list . and by incrementing first=first->next we are also traversing LL . so its not parrallel working not a single traversal

Any other soln.