Stacks
Stacks
Stacks
INFORMATION TECHONOLOGY
2ND YEAR
3RD SEM
SUBJECT : DSA
SUBJECT CODE : PCC-CS301
ROLL NO. : 11200223009
A SINGLE LINEAR LINKED LIST is a data structure that consists of a
sequence of nodes, each containing a data element and a reference (or link)
to the next node in the sequence. The first node in the list is called the head,
and the last node is called the tail. The tail node's link points to NULL,
indicating the end of the list.
3. Insert Node
The new node is now successfully inserted into the linked list, maintaining
the order and connectivity of the nodes.
1. Locate Node
Identify the node to be deleted by traversing the list and comparing the data
element of each node with the target data element.
2. Update References
Adjust the references of the nodes before and after the deleted node to
maintain the connectivity of the list.
3. Free Memory
Release the memory occupied by the deleted node, making it available for
future use.
1. Start at Head
Begin the traversal at the head node, which is the first node in the list.
2. Follow Reference
Follow the reference (or pointer) from the current node to the next node in the
sequence.
3. Repeat
Repeat the process of following the reference until you reach the tail node,
which has a NULL reference, indicating the end of the list.
Databases : Linked lists are used in databases for storing and retrieving
data, particularly in situations where the data is dynamically changing.