Download presentation
Presentation is loading. Please wait.
Published byClaire Shaw Modified over 8 years ago
1
Array is a data structure were elements are stored in consecutive memory location.in the array once the memory is allocated.it cannot be extend any more. This is why array is known as static data structure. In contrast to this, linked list is called dynamic data structure were amount of memory required can be varied during its use. Def: A linked list is an ordered collection of finite homogeneous data elements called nods where the linear order is maintained by means like or pointers Each item has a data part (one or more data members), and a link that points to the next item One natural way to implement the link is as a pointer; that is, the link is the address of the next item in the list It makes good sense to view each item as an object, that is, as an instance of a class. We call that class: Node The last item does not point to anything. We set its link member to NULL. This is denoted graphically by a self-loop
2
Types of linked list: Single linked list Double linked list Circular linked list Operations linked list: Traversing a list. Insertion of a node into a list. Deletion of a node from a list. Copy a linked list to make a duplicate. Merging two linked lists into a largest list. Searching for an element in a list
3
Single linked list In a single linked list each node contains only one link which points the subsequent node in the list. Nodes are linked in direction Insertion ABC
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.