Thread: Doubt on Linked lists and doubly LL!

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    14

    Doubt on Linked lists and doubly LL!

    hello all,

    I have problem with linked lists.
    In calling functions(add,delete) using single pointer parameter(ie. add(struct node *p,char value)).

    .please, any one give me an idea and example program to do clearly understand both single and doubly LL concepts.

    pls, help me.
    Thanks in advance.

    bye.

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    I have problem
    Og understand. Og have problem too.

    If you understand pointers, linked lists should come with a "Oh! That does make sense!". If they didn't:
    Linked lists are merely lists where, instead of allocating the entire list at a time (like arrays), you allocate memory for each item at a time. Since these items are going to be in random locations in memory, they have to be "linked" together: In a singly linked list, each item knows where the next item is, and in a doubly linked list they know where the next and previous item is.

    A singly linked list remembers where the next item is via a pointer to it, like such:
    Code:
    struct listitem
    {
      int data;
      char moredata[20];
      struct listitem *next_item;
    };
    To keep track of the list as a whole, all you need is a pointer to the first item. For the last item, next_item would be NULL.

    Any specifics that confuse you? You can Google "linked list" for some info...
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Doubly linked lists
    By mohanlon in forum C Programming
    Replies: 8
    Last Post: 12-08-2010, 01:01 AM
  2. Doubly Linked Lists
    By Swerve in forum C++ Programming
    Replies: 6
    Last Post: 03-23-2009, 12:51 PM
  3. doubly linked lists conversion
    By bazzano in forum C Programming
    Replies: 1
    Last Post: 04-28-2007, 08:35 PM
  4. doubly linked lists
    By cworld in forum C++ Programming
    Replies: 2
    Last Post: 04-21-2002, 09:33 AM
  5. doubly linked lists
    By qwertiop in forum C++ Programming
    Replies: 3
    Last Post: 10-03-2001, 06:25 PM