A linked list stores values in nodes. Each node points to the next node, so the sequence is formed by references rather than by contiguous indexes.

Linked lists are useful for understanding pointer-like structure, even though Python algorithm solutions often use lists unless the problem specifically gives linked-list nodes.

Core Idea

The central operation is following links. To reach the third node, the algorithm starts at the head and moves through next references.

This makes access by position slower than an array, but insertion or removal can be efficient when the algorithm already has the relevant node reference.

Python Example

class Node:
    def __init__(self, value, next_node=None):
        self.value = value
        self.next = next_node
 
 
head = Node(1, Node(2, Node(3)))
 
current = head
while current is not None:
    print(current.value)
    current = current.next

The loop does not use indexes. It walks from node to node.

Common Confusions

A linked list is not just a Python list with different operations. A Python list stores elements in an indexable sequence. A linked list stores nodes connected by references.

Another common mistake is losing the rest of the list when changing links. If node.next is overwritten before the old next node is saved, the remaining chain may become unreachable.

When To Use It

Use linked-list reasoning when the input is explicitly a linked list, when practicing pointer manipulation, or when a problem asks for operations such as reversing links, detecting cycles, or merging sorted node chains.