Back to Problem Solving with DSA

~/blog/tutorials/problem-solving-with-dsa

Linked List

Linked List

A linked list is a chain of nodes where each node holds data and a reference to the next one. That's the whole model. The trade is that you give up O(1) random access — to find the 50th element, you walk from the head — and you get O(1) insertion and deletion once you're at the right position.

This section builds the linked list from scratch. Four posts that cover construction, traversal, mutation, and search.

What's in this section

  1. Introduction to linked lists — Node class, linking, traversal, the LinkedList wrapper
  2. Taking input and length — building a list from data, measuring its size
  3. Insertion and deletion — head, tail, and position variants
  4. Searching — finding a value by traversal

Start with the first post if you've never built a linked list before. Skip ahead if you have.