Take 2 pointers at the beginning and move 1 pointer by 1 step and 2nd by 2 steps until end of list....after that position of 1st pointer will be the mid point of a singly list...
On Wed, Sep 29, 2010 at 1:24 AM, Divesh Dixit < dixit.coolfrog.div...@gmail.com> wrote: > Given a singly-linked, find out (just give the basic logic) the mid > point of a single linked list in a single parse of the list. Assume > the program would be loaded in read-only memory so no manipulation of > the list is allowed. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.