Himanshu Chauhan <> wrote:
> Hi!
> I was wondering, In the first parse of a singly linked list of unknown
> length, is it possible to know when we are at middle of the linked list?
Are you looking for the old trick of using two pointers, the first
one always getting set to the next element, the other one being set
to the successor of the next element so, when the second pointer
reaches the end of the list, the first one points to the middle
element? But I don't know if that is allowed by what you call
"first parse".
BTW, this hasn't anything to do with C, so such a question is
much better suited for comp.programming.
Regards, Jens
--
\ Jens Thoms Toerring ___
\__________________________
http://toerring.de