Linked - List
Linked - List
Course Objectives
3
Scheme of Evaluation
4
• A linked list is a linear data structure, in
which the elements are not stored at
contiguous memory locations.
Link List
5
ARRAYS VS • Arrays and Linked Lists both are direct
information structures, yet the two of them
LINK LISTS have a few points of interest and drawbacks
over one another.
6
INSERTING AT BEGINNING OF THE LIST
Lets START is the pointer having the initial position in linked list.
Let data be the element to be inserted in the new node.
POS is the mark where the new node is to be inserted.
TEMP is a temporary pointer to hold the node address.
1. Input data
2. Develop a New Node
3. New Node → DATA = data
4. New Node → Next = NULL
5. If (START equal to NULL)
then START = New Node.
7
INSERT A NODE AT THE END
Begin
1. Input DATA
2. develop a New Node
3. New Node → DATA = DATA
4. New Node → Next = NULL
5. If (START equal to NULL)
(a) START = New Node
6. Else
(a) TEMP = START
(b) While (TEMP → Next not equal to NULL)
(i) TEMP = TEMP → Next
7. TEMP → Next = New Node
Exit
8
DELETION
• In order to delete FIRST node from linked list we have to consider three possibilities:
(1) List is Empty (START = NULL). In this case we can not delete node from linked list.
(3) There are more then one nodes in the linked list. In this case we can delete the first node.
After deleting the first node we have to move FIRST pointer to next node so that it can points to the newly first node in
the linked list.
9
DELETION
• In order to delete FIRST node from linked list we have to consider three possibilities:
(1) List is Empty (START = NULL). In this case we can not delete node from linked list.
(3) There are more then one nodes in the linked list. In this case we can delete the first node.
After deleting the first node we have to move FIRST pointer to next node so that it can points to the newly first node in
the linked list.
10
FAQ
11
APPLICATION OF LINK LIST
• Pre-characterized number of classifications suggests that we can utilize a basic static structure like
cluster to speak to the classes. Since we don't have the foggiest idea about the quantity of things
in every class, we can speak to things in every classification utilizing a connected rundown. So
what we need is a variety of connected records
• You can likewise consider speaking to a web list utilizing a variety of connected records, where
exhibit contains the catchphrases and connected records contains the web URL's the place that
watchword happens.
12
REFERENCES
• https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/linked%20lists.html
• https://www.geeksforgeeks.org/data-structures/linked-list/
• https://www.tutorialspoint.com/data_structures_algorithms/linked_list_algorithms.htm
• https://www.geeksforgeeks.org/merge-two-sorted-lists-place/
• https://www.geeksforgeeks.org/reverse-a-linked-list/
13
THANK YOU