Linked list type comprise node containing pointer to predecessor & successor - Data Structure

Q.  Which type of linked list / s comprise / s a node containing a pointer to predecessor as well as successor?
- Published on 27 Aug 15

a. Doubly Linked List
b. Circular Linked List
c. Both a & b
d. None of the above

ANSWER: Both a & b
 

    Discussion

  • Nirja Shah   -Posted on 18 Nov 15
    Doubly link list contains pointers to predecessor as well as successor. In Doubly link list each node has two pointers. One pointer points to the next node and the other points to the previous node.
    Example:
    struct node
    {
        Int data;
        struct node ∗prev;
        struct node ∗next;
    }
    In the above example, pointer named prev will contain the address of previous node and next pointer will contain the address of next node. By using these two pointers we can move in both directions at any time.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)