DYNAMIC DATA STRUCTURE
SHYAM REGHU
S3 CSE ROLL.NO: 41
GEC IDUKKI
CONTENTS
– LIMITATIONS OF AN ARRAY
– DYNAMIC DATA STRUCTURE
– INSEARTION AND DELETION
– ADVANTAGES
– SPECIAL TYPE OF DYNAMIC STRUCTURES
– CONCLUSION
Limitations of an Array
• LIMITED SIZE
• ITEMS OF SAME DATA TYPE CAN BE ONLY STORED
• DIFFICULT TO ADD ELENT TO SORTED ARRAY
• SOME TIMES IT WASTE THE MEMORY
• STATIC DATA STRUCTURE.
CONSIDER AN ARRAY OF SIZE 7
THIS LEAD TO THE CONCEPT OF LINKED LIST..
• WHAT IS A LINEAR LINKED LIST ?
• an ordered set of data elements, each containing a
link to its successor (and sometimes its predecessor).
• It is a sequence of nodes.
• Each node stores
– element
– link to the next node
next
elem node
• A linked list is a series of connected nodes
• Each node contains at least
– A piece of data (any type)
– Pointer to the next node in the list
• Head: pointer to the first node
• Tail : The last node points to NULL
Starting Node
Let's go through an Example
INSERTION
DELETION
• To delete the node DS from the link
Advantages of Linked Lists
• They are a dynamic in nature which allocates
the memory when required.
• Insertion and deletion operations can be
easily implemented.
• Stacks and queues can be easily executed.
• Linked List reduces the access time.
CIRCULAR LINKED LIST
• A Circular Linked List is a special type of Linked List
• It supports traversing from the end of the list to the beginning
by making the last node point back to the head of the list
• A Rear pointer is often used instead of a Head pointer(the last
node point back to the first node )
REAR
10 20 40 7055
USES OF CIRCULAR LINKED LIST
• Circular linked lists are useful for playing video
and sound files in “looping” mode.
• They are also a stepping stone to
implementing graphs.
Doubly-Linked List
• info: the user's data.
• next, back: the address of the next and
previous node in the list.
back nextinfo
– Each node points to not only successor but the
predecessor
– There are two NULL: at the first and last nodes
in the list
– Advantage: Given a node, it is easy to visit its
predecessor. Convenient to traverse lists
backwards
A B C 
• A linked list is a dynamic data structure
• Which is a sequence of nodes
• Advanced linked lists are circular and double
linked list
• We can allocate memory when it is required
• It is difficult to locate an item in the middle
position.
PRESENTED BY…….
SHYAM REGHU
S3 CSE ROLL.NO: 41
GEC IDUKKI

Dynamic data structures

  • 1.
    DYNAMIC DATA STRUCTURE SHYAMREGHU S3 CSE ROLL.NO: 41 GEC IDUKKI
  • 2.
    CONTENTS – LIMITATIONS OFAN ARRAY – DYNAMIC DATA STRUCTURE – INSEARTION AND DELETION – ADVANTAGES – SPECIAL TYPE OF DYNAMIC STRUCTURES – CONCLUSION
  • 3.
    Limitations of anArray • LIMITED SIZE • ITEMS OF SAME DATA TYPE CAN BE ONLY STORED • DIFFICULT TO ADD ELENT TO SORTED ARRAY • SOME TIMES IT WASTE THE MEMORY • STATIC DATA STRUCTURE.
  • 4.
    CONSIDER AN ARRAYOF SIZE 7 THIS LEAD TO THE CONCEPT OF LINKED LIST..
  • 6.
    • WHAT ISA LINEAR LINKED LIST ? • an ordered set of data elements, each containing a link to its successor (and sometimes its predecessor). • It is a sequence of nodes. • Each node stores – element – link to the next node next elem node
  • 8.
    • A linkedlist is a series of connected nodes • Each node contains at least – A piece of data (any type) – Pointer to the next node in the list • Head: pointer to the first node • Tail : The last node points to NULL
  • 9.
  • 10.
    Let's go throughan Example
  • 11.
  • 12.
    DELETION • To deletethe node DS from the link
  • 13.
    Advantages of LinkedLists • They are a dynamic in nature which allocates the memory when required. • Insertion and deletion operations can be easily implemented. • Stacks and queues can be easily executed. • Linked List reduces the access time.
  • 14.
    CIRCULAR LINKED LIST •A Circular Linked List is a special type of Linked List • It supports traversing from the end of the list to the beginning by making the last node point back to the head of the list • A Rear pointer is often used instead of a Head pointer(the last node point back to the first node ) REAR 10 20 40 7055
  • 15.
    USES OF CIRCULARLINKED LIST • Circular linked lists are useful for playing video and sound files in “looping” mode. • They are also a stepping stone to implementing graphs.
  • 16.
    Doubly-Linked List • info:the user's data. • next, back: the address of the next and previous node in the list. back nextinfo
  • 17.
    – Each nodepoints to not only successor but the predecessor – There are two NULL: at the first and last nodes in the list – Advantage: Given a node, it is easy to visit its predecessor. Convenient to traverse lists backwards A B C 
  • 18.
    • A linkedlist is a dynamic data structure • Which is a sequence of nodes • Advanced linked lists are circular and double linked list • We can allocate memory when it is required • It is difficult to locate an item in the middle position.
  • 20.
    PRESENTED BY……. SHYAM REGHU S3CSE ROLL.NO: 41 GEC IDUKKI