2. CONTENTS
– LIMITATIONS OF AN ARRAY
– DYNAMIC DATA STRUCTURE
– INSEARTION AND DELETION
– ADVANTAGES
– SPECIAL TYPE OF DYNAMIC STRUCTURES
– CONCLUSION
3. 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.
4. CONSIDER AN ARRAY OF SIZE 7
THIS LEAD TO THE CONCEPT OF LINKED LIST..
5.
6. • 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
7.
8. • 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
13. 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.
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 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.
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 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
18. • 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.