need help in doubly linked list

Discussion in 'C++' started by zoro, Nov 20, 2006.

  1. zoro

    zoro Guest

    hello:
    i'm not sure what the operations that would be affected if we didn't
    maintain a tail pointer in doubly linked list?

    so why is it important?

    your help is appreciated
    thank you
     
    zoro, Nov 20, 2006
    #1
    1. Advertising

  2. zoro

    Jim Langston Guest

    "zoro" <> wrote in message
    news:...
    > hello:
    > i'm not sure what the operations that would be affected if we didn't
    > maintain a tail pointer in doubly linked list?
    >
    > so why is it important?
    >
    > your help is appreciated
    > thank you


    To know when to stop, so you don't run off the end of the list. You have to
    have someway to know when there is no node following.
     
    Jim Langston, Nov 20, 2006
    #2
    1. Advertising

  3. zoro

    Guest

    On 20 Nov, 13:24, "Jim Langston" <> wrote:
    > "zoro" <> wrote in messagenews:...
    >
    > > hello:
    > > i'm not sure what the operations that would be affected if we didn't
    > > maintain a tail pointer in doubly linked list?

    >
    > > so why is it important?

    >
    > > your help is appreciated
    > > thank youTo know when to stop, so you don't run off the end of the list.. You have to

    > have someway to know when there is no node following.


    That can be accomplished in other ways, like a null-pointer for
    instance. What you can't do however is to begin a reverse traversal
    without first making a normal traversal. It also allows quic insertion
    of new elements at the end of the list since you don't have to traverse
    the list to find the end each time.

    --
    Erik Wikström
     
    , Nov 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. murali@pune

    doubly linked list

    murali@pune, Mar 23, 2006, in forum: Java
    Replies:
    3
    Views:
    930
    bugbear
    Mar 24, 2006
  2. darth
    Replies:
    0
    Views:
    457
    darth
    Apr 30, 2004
  3. chand
    Replies:
    7
    Views:
    322
    Terry Reedy
    Sep 5, 2005
  4. dssuresh6

    need for doubly linked list

    dssuresh6, Nov 18, 2004, in forum: C Programming
    Replies:
    4
    Views:
    628
    J. J. Farrell
    Nov 19, 2004
  5. Mahesh
    Replies:
    1
    Views:
    1,329
    Richard Heathfield
    Mar 19, 2008
Loading...

Share This Page