Data Structure Unit 3 PPT Cs 3rd WK
Data Structure Unit 3 PPT Cs 3rd WK
• A linked list is 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. Linked list is the second most-used data structure
after array. Following are the important terms to understand the concept of
Linked List.
Link − Each link of a linked list can store a data called an element.
Next − Each link of a linked list contains a link to the next link called Next.
LinkedList − A Linked List contains the connection link to the first link called First.
Linked List Representation
Now, the next node at the left should point to the new node.
LeftNode.next −> NewNode;
This will put the new node in the middle of the two. The new list should look like this −
Similar steps should be taken if the node is being inserted at the beginning of
the list. While inserting it at the end, the second last node of the list should
point to the new node and the new node will point to NULL.
Deletion Operation