Represent a sequence through links
A singly linked list stores a value and a next-node reference in each node. A head reference identifies the start, and repeatedly following next references reveals the sequence. Nodes do not have to occupy adjacent addresses. This flexibility removes the address formula used by an array: reaching the node at index i generally requires walking through the preceding nodes. Consequently, indexed access is linear in the distance traversed. Whether a list is singly or doubly linked, or stores a tail reference, changes the operations it supports efficiently.
Work through an insertion
Suppose the sequence is A → B → C and a reference to B is already available. To insert X after B, first set X.next to C and then set B.next to X. Existing values need not be shifted as they would in an ordered array. The pointer changes take constant time, but this does not include searching for B. An operation described as “find B by value and insert after it” normally includes a linear traversal. Always state whether a position or predecessor reference is supplied.
Handle removal and boundary cases
Removing X from a singly linked list usually means redirecting its predecessor to X.next. A reference to X alone need not reveal that predecessor. Removing the first element also requires updating the head reference, and removing the final element can affect a stored tail reference. A doubly linked list adds previous links, making removal of a known node more direct, at the cost of extra space and more links to maintain. In manual-memory languages, removing a node must also be coordinated with ownership and the lifetime of outstanding references.
Compare the entire workload
Lists are useful when operations frequently rewire known parts of a sequence, and they can implement queues and other structures. They also pay for link storage, separate allocations, and pointer chasing. Those costs can make a simple array faster for sequential traversal even though shifting array elements sounds expensive. A singly linked list can append in constant time if it maintains an appropriate tail reference; without one, locating the end requires traversal. Select the representation by measuring the actual mixture of lookup, insertion, deletion, traversal, and memory use, rather than relying on a single operation bound.