Visualize a doubly linked list with both next and prev pointers. Insert, search, and delete operations with bidirectional traversal.
A Singly Linked List is a linear data structure of nodes where each node contains a data field and a pointer to the next node.
Each node holds a value and a "next" pointer to the following node. The last node points to null.
Traverse the list from the Head, comparing each node until the target value is found or null is reached.
Creates a new node and links the current Tail to this new node, making it the new Tail.
Creates a new node and makes it the new Head, linking it to the previous head.
Inverts the direction of all pointers in the list. The head becomes the tail and the tail becomes the head.
Uses two pointers separated by N nodes. When the leading pointer reaches the end, the trailing pointer is at the node before the one to remove.
The "Slow" pointer moves 1 step while the "Fast" pointer moves 2 steps. When Fast reaches the end, Slow is at the exact middle.
Insertion at Head (Prepend) is O(1). Search and general deletion takes O(N) time because we lack random access to elements.