presented by:
Warda Aziz
Huba akhtar
Shifa Idrees
Amber Wajid
Double Linked List
TOC:
• LIST
• LINKED LIST
• PICTORIAL REPRESENTATION
• ADVANTAGES
• DISADVANTAGES
• DOUBLE LINKED LIST
• EXPLANATION
• POINTS TO BE NOTED
• OPERATIONS
• INSERTION
• DELETION
• DISPLAY
• CODE
• ADVANTAGES
• DISADVANTAGES
List???
Definition:
A list is a collection of same type of objects.
It can be :
 linked list
 double linked list
 circular linked list
 double and circular linked list
linked list
Definition:
• A data structure that consists of a sequence of
data record such that in each record there is a
field that contains a reference of next record in
a sequence.
A sequence of data structures, which are connected together via
links. Linked list is a sequence of links which contains items.
Each link contains a connection to another link.
Pictorial Representation
head
node
End
node
ADVANTAGES
4: No need to define
initial size of the list
3: Addition/removal from the mi
ddle
1: Stacks and queues can be impleme
nted
2: Insertion and
deletion is
faster
Disadvantages
More memory than arrays!
sequential order, read from the beginning
time to access individual elements
one way direction
reverse traversing!!!
Double linked list
Definition:
Double linked list is a sequence of elements in
which every element has links to its previous
element and next element in the sequence..
Or
Double linked list is a two-way list because
one can move in either from left to right or fr
om right to left.
Explanation :
Every node has link to its previous node and next
node . So , we can traverse forward by using next f
ield and can traverse backward by using previous
field. Every node in double linked list contains thr
ee fields.
link 1 data link2
value of that node
Points to
a
previous
node
points to
next
node
Example:
N
2
3
1
1
3
2
5N N
Fron
t
P O I N T S T O B E N O T E D :
 In double linked list ,the first node must be always pointed by HEAD.
Always the previous field of the first node must be NULL.
Always the next field of the last node must be NULL.
Operations:
In a double linked list , we perform the following
operations…
1. Insertion
2. Deletion
3. Display
Insertion:
In double linked list ,the insertion operation ca
n be performed in three ways as follows…
1. Inserting At Beginning of the list
2. Inserting At End of the List
3. Inserting At Specific Location in the list
Deletion :
In double linked list ,the deletion operation ca
n be performed in three ways as follows…
1. Deletion At Beginning of the list
2. Deletion At End of the List
3. Deletion At Specific Location in the list
Displaying:
Double linked list can be Displayed
by writing a Piece of Code in your
Program..
ADVANTAGES:-
1) We can traverse in both direction i.e from
starting to end & as well as from end to starti
ng.
2) It is easy to reverse the linked list.
3) If we are at a node, the we can go at any
node. But in linked list , it is not possible to
reach the previous node.
Disadvantages:
1) It requires more space per space per node
because 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.

Double link list

  • 1.
    presented by: Warda Aziz Hubaakhtar Shifa Idrees Amber Wajid Double Linked List
  • 2.
    TOC: • LIST • LINKEDLIST • PICTORIAL REPRESENTATION • ADVANTAGES • DISADVANTAGES • DOUBLE LINKED LIST • EXPLANATION • POINTS TO BE NOTED • OPERATIONS • INSERTION • DELETION • DISPLAY • CODE • ADVANTAGES • DISADVANTAGES
  • 3.
  • 4.
    Definition: A list isa collection of same type of objects. It can be :  linked list  double linked list  circular linked list  double and circular linked list
  • 5.
  • 6.
    Definition: • A datastructure that consists of a sequence of data record such that in each record there is a field that contains a reference of next record in a sequence.
  • 7.
    A sequence ofdata structures, which are connected together via links. Linked list is a sequence of links which contains items. Each link contains a connection to another link.
  • 8.
  • 9.
    ADVANTAGES 4: No needto define initial size of the list 3: Addition/removal from the mi ddle 1: Stacks and queues can be impleme nted 2: Insertion and deletion is faster
  • 10.
    Disadvantages More memory thanarrays! sequential order, read from the beginning time to access individual elements one way direction reverse traversing!!!
  • 11.
  • 12.
    Definition: Double linked listis a sequence of elements in which every element has links to its previous element and next element in the sequence.. Or Double linked list is a two-way list because one can move in either from left to right or fr om right to left.
  • 13.
    Explanation : Every nodehas link to its previous node and next node . So , we can traverse forward by using next f ield and can traverse backward by using previous field. Every node in double linked list contains thr ee fields.
  • 14.
    link 1 datalink2 value of that node Points to a previous node points to next node
  • 15.
  • 16.
    P O IN T S T O B E N O T E D :  In double linked list ,the first node must be always pointed by HEAD. Always the previous field of the first node must be NULL. Always the next field of the last node must be NULL.
  • 17.
    Operations: In a doublelinked list , we perform the following operations… 1. Insertion 2. Deletion 3. Display
  • 18.
    Insertion: In double linkedlist ,the insertion operation ca n be performed in three ways as follows… 1. Inserting At Beginning of the list 2. Inserting At End of the List 3. Inserting At Specific Location in the list
  • 19.
    Deletion : In doublelinked list ,the deletion operation ca n be performed in three ways as follows… 1. Deletion At Beginning of the list 2. Deletion At End of the List 3. Deletion At Specific Location in the list
  • 20.
    Displaying: Double linked listcan be Displayed by writing a Piece of Code in your Program..
  • 21.
    ADVANTAGES:- 1) We cantraverse in both direction i.e from starting to end & as well as from end to starti ng. 2) It is easy to reverse the linked list. 3) If we are at a node, the we can go at any node. But in linked list , it is not possible to reach the previous node.
  • 22.
    Disadvantages: 1) It requiresmore space per space per node because 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.