KEMBAR78
Doubly Linked List | PPTX
Doubly-Linked List
Doubly Linked List
1.) In doubly linked list each node contains two
pointers.
2.) which points has a reference to both the next point
and pervious point of node in list.
3.) A doubly linked list is a two-way list because one
can move in either from left to right or from right to
left
Info
prev next
NODE
Node Data
 Info : the user’s data.
 Prev, Next : the address of next and
previous node in list
Operations on a Doubly linked list
1) Create list.
2) Insert element at beginning in list.
3) Insert element at end in list.
4) Insert element at any place in list.
5) Delete element from the beginning of list.
6) Delete element from the end of list.
7) Delete element from any place from list.
Create doubly linked list
NULL
7 X
Create One another node
9X X
Insert an element at beginning
doubly linked list
Delete an element at any place
doubly linked list
Doubly Linked list
Advantages
1. We can traverse in
both directions i.e. from
starting to end and as
well as from end to
starting.
2. It is easy to reverse the
linked list.
3. If we are at a node,
then we can go to any
node. But in linear linked
list, it is not possible to
reach the previous node.
Disadvantages
1. It requires more space
per space per node
because one extra field is
required for pointer to
previous node.
2. Insertion and deletion
take more time than
linear linked list because
more pointer operations
are required than linear
linked list.
Doubly Linked List

Doubly Linked List

  • 1.
  • 2.
    Doubly Linked List 1.)In doubly linked list each node contains two pointers. 2.) which points has a reference to both the next point and pervious point of node in list. 3.) A doubly linked list is a two-way list because one can move in either from left to right or from right to left
  • 3.
    Info prev next NODE Node Data Info : the user’s data.  Prev, Next : the address of next and previous node in list
  • 4.
    Operations on aDoubly linked list 1) Create list. 2) Insert element at beginning in list. 3) Insert element at end in list. 4) Insert element at any place in list. 5) Delete element from the beginning of list. 6) Delete element from the end of list. 7) Delete element from any place from list.
  • 5.
    Create doubly linkedlist NULL 7 X Create One another node 9X X
  • 6.
    Insert an elementat beginning doubly linked list
  • 7.
    Delete an elementat any place doubly linked list
  • 8.
    Doubly Linked list Advantages 1.We can traverse in both directions i.e. from starting to end and as well as from end to starting. 2. It is easy to reverse the linked list. 3. If we are at a node, then we can go to any node. But in linear linked list, it is not possible to reach the previous node. Disadvantages 1. It requires more space per space per node because one extra field is required for pointer to previous node. 2. Insertion and deletion take more time than linear linked list because more pointer operations are required than linear linked list.