Introduction

Why Linked Lists?

Linked lists are the foundational heap-allocated data structure. Before you can understand trees, graphs, hash tables, or memory allocators, you need to understand the linked list — because they all share the same core idea: nodes connected by pointers.

They appear everywhere in systems programming:

  • Operating systems — the Linux kernel uses doubly-linked lists extensively (process lists, wait queues, LRU caches).
  • Memory allocators — free blocks are tracked as a linked list.
  • Compilers — symbol tables and intermediate representations use linked structures.
  • Undo/redo — editor history is a linked list of states.

Why C?

Linked lists without manual memory management are just exercises. In C, you call malloc to allocate each node, you own the pointer, and you call free when you are done. That is the full picture — no garbage collector hiding the cost.

Implementing a linked list in C teaches you:

  • How heap allocation works at the function-call level.
  • Why pointer manipulation requires care (NULL checks, prev/cur tracking).
  • What languages like Python and Java are doing behind their list objects.

What You Will Learn

This course contains 12 lessons organized into 4 chapters:

  1. The Node — Define the Node struct, allocate nodes with malloc, traverse and print a list, and measure its length.
  2. Insertions & Deletions — Insert at the front (O(1)), insert at the back (O(n)), and remove the front node.
  3. Search & Access — Linear search, O(n) index access, and delete-by-value with the prev/cur two-pointer pattern.
  4. Classic Problems — Three interview staples: nth-from-end (fast/slow pointers), in-place reversal, and merging two sorted lists.

Each lesson explains the algorithm, walks through a worked example, and gives you a function to implement.

Let's build lists.

Next →