[OT] traversing linked lists (was Re: hi)



Ganga wrote:
> Can anybody tell me how to find out middle node of a link list without
> traversing all the nodes.

Hi to you, too!

1) Please use more informative subject lines than "hi" (try also to
capitalise properly). Something like I changed it to might have been
appropriate.

2) The /method/ of achieving what you ask about is more appropriate to
comp.programming, and is at least slightly off topic here.

3) Once you have a C program that tries to achieve your goal, and you
have questions about how/why it does (not) work, asking here is a good
idea.

4) Your question is not specified well enough. Are you talking about
singly- or doubly-linked lists, or even yet other kind? E.g., an idea
for always knowing the middle element, with absolutly no processing, is
to construct a linked list which grows in two directions from its root,
the root also holding the information about whether to next grow to the
left or to the right. However, I doubt that was what you were asking
for. ;-)

Cheers

Vladimir

.



Relevant Pages

  • Re: kmail wont import eudora addresses
    ... As root I looked at the std.vcf file and it is empty even ... > though the kmail program lists all the imported eudora addresses. ... > as root there was no problem with importing the list. ... In previous versions of Kab and Kaddressbook you could use several ...
    (comp.os.linux.misc)
  • Re: Issues mirroring drives with Vinum in FreeBSD 4.8-RELEASE
    ... Having seen that message in many of your replies on the lists, ... vinum: reading configuration from /dev/da0s1h ... using volume root for root device ... fstab: /etc/fstab:9: Inappropriate file type or format ...
    (freebsd-questions)
  • Re: Can not run Programs that Require Root Access
    ... updates I click on view packages & it asks for my root password. ... I've just recently installed FC7, ... I read messages from the public lists. ...
    (Fedora)
  • Re: [opensuse] There will be no reply-to-muning on this list
    ... problem lies (the mail server settings) ... You're absolutely right about solving it at the root, ... Standards are what allows us to interoperate. ... On lists that do not munge, I've never had anyone send a message to the ...
    (SuSE)
  • Re: Update problems
    ... You can't run apt-* from the command line as your regular user account. ... The root account has no password and, as such, can't be logged in. ... For single commands, or small lists of them, the second one if the ...
    (Ubuntu)