A lesson from the Data Structures module of the bootcamp. About an 11 minute read.
A linked list chains nodes together with pointers instead of laying them out in a block. In real code you will reach for one rarely. In interviews, and in your own understanding, it earns its place for a different reason: it is the first structure made of nodes that point at other nodes, and getting comfortable rewiring pointers here is what makes trees feel easy instead of scary.
Each node holds a value and a reference to the next node. There is no index and no math: to reach the fifth item, you start at the head and follow four links. The practical case for linked lists is weaker than textbooks suggest, since cache locality usually lets an array win even where the complexity table says otherwise. The real case is this: a linked list is a tree where every node has exactly one child. Everything you learn here transfers directly to trees with two children and then to graphs with many: holding a pointer to the previous node, not losing the rest of the list when you reassign a link, and what null means at the end. It is the shallow end of the same pool.
The rest of this lesson continues with 5 further sections. See the full curriculum.
Browse all 576 practice puzzles