Learning order

1. Array

Free

Start your learning journey by understanding the most fundamental data structure.

Show Index

2. Singly Linked List

Free

Learn in-depth the most fundamental data structure in a programmer's life

Show Index

3. Doubly Linked List

Premium

Learn about the extension of the singly linked list that powers stacks and queues

Show Index

4. Hash Table

Premium

Learn how applications deal with key value mappings efficiently

Show Index

5. Stack

Premium

The data structure behind recursion, memory management, and much more

Show Index

6. Queue

Premium

Learn about the data structure that powers CPU and disk scheduling algorithms

Show Index

7. Binary Tree

Premium

Learn all about the most critical data structure in computer science

Show Index

8. Binary Search Tree

Premium

Learn about the most critical search data structure in computer science

Show Index

9. Heap

Premium

Learn all how a tree can be used as a priority queue

Show Index

10. Graph

Premium

Learn about the most dynamic data structure in computer science

Show Index

What you will learn

How linked lists scatter nodes across memory and trade random access for O(1) head insertion

The reversal pattern in both forms: direct list reversal and reversal as a subproblem

Sliding window traversal using two references kept a fixed distance apart

Fast and slow pointers for middle node search, cycle detection, and palindrome checks

Split, merge, and reorder using dummy heads and parallel tail references

How Floyd's tortoise and hare algorithm finds a cycle in O(N) time and O(1) space

Why this course

A linked list is a node holding a value and a pointer to its neighbour. Defining it takes one sentence. Reversing one without losing the rest of the list, finding the middle in a single pass, or merging two sorted chains in place is choreography: three references moving in the right order, any slip erasing half the list. The trouble is rarely the structure. It is the pointer hygiene.

This course rebuilds singly linked lists from the single-node primitive up, then walks through the seven pointer manipulation patterns that cover almost every linked list question you will see in a coding interview. You finish by implementing a singly linked list of your own with every supported operation working at its tightest complexity.

Requirements

The course assumes you can read code in any mainstream language and have written a function or two that mutates an object through a reference.

  • Comfort writing loops, conditionals, and small functions in at least one language.
  • A working idea of references or pointers (passing an object into a function and mutating it from inside).
  • Basic Big-O notation literacy: O(N), O(1), O(log N).

Overview

A singly linked list is the data structure that motivates every other pointer-based structure in computer science. Stacks, queues, hash table chains, trees, graphs, and adjacency lists all sit on the same primitive: a node with a value and a reference to its neighbour. It is also where most engineers first meet the cost of indirection. Walking an array of one million integers stays in cache; walking a linked list of one million nodes touches one million scattered addresses, which is why production systems often prefer arrays even when textbook complexity favours a list.

Representation of a singly linked list

The course teaches both halves of the topic: how the structure works at the pointer level, and how to recognise which of the seven patterns a given problem fits into.

Fundamentals

The course opens with the node, the primitive every linked list operation manipulates. You see how each node packages a data field with a next reference, how a head pointer anchors the chain, and how the tail node's null next is the stop signal traversal listens for. From there the cost of every supported operation follows directly: access by index is O(N) because you have to walk from the head, head insertion is O(1) because no shifting is needed, and tail insertion without a tail reference is O(N) because you have to find the end first.

Insertion and deletion are then taught as a family rather than as a list of recipes to memorise. You see five insertion variants (at the head, at the tail, after a given node, before a given node, at distance X) and seven deletion variants (first node, last node, by value, after a node, before a node, by node reference, at distance X), and how each variant decomposes into the same two-or-three pointer rewires once you know which neighbour reference you are missing.

The fundamentals close with Floyd's tortoise and hare algorithm. You walk through why two pointers moving at different speeds detect a cycle in O(N) time and O(1) space, then extend the same idea to find the cycle's entry node. This sets up a recurring theme of the rest of the course: most non-trivial singly linked list problems are solved by running two references over the list at the same time, in different ways.

Problem solving

After the fundamentals, the rest of the course is patterns. Most linked list problems you see in an interview reduce to one of seven templates, and once you can recognise the template the pointer wiring becomes the only hard part.

The 7 singly linked list patterns you'll master
Reversal
A three-pointer walk with previous, current, and next references that reverses the whole list or a segment of it in place in O(N) time and O(1) space. Reverse a List, Reverse First K Nodes, Reverse Last K Nodes, Reverse the Given Segment.
Reversal as a subproblem
Decompose a harder problem into repeated segment reversals chained together with a dummy head and a connector reference, the building block underneath the medium and hard list problems. Pairwise Swap, Reverse K Segments, Reverse Increasing Groups, Reverse Alternate Segments.
Sliding window traversal
Two references kept exactly K nodes apart and advanced together, solving Nth-from-end problems in a single pass with O(1) auxiliary space. K Maximum Sum, Trim Nth Node, Swap Nth Nodes, K Rotations.
Fast and slow pointers
Two references moving at different speeds to land on a proportional position in one pass, the same mechanic Floyd's cycle detection uses. Middle Node Search, Split List in Half, Equal Halves, Palindrome Checker.
Split
Distribute nodes into K separate output lists in a single pass using parallel dummy heads and per-list tail references, running in O(N) time and O(1) auxiliary space. Even Odd Split, Split Alternate Groups, Split By Modulo, K Way List Split.
Merge
Combine two or more lists into one by choosing the next node via a selector function, using a dummy head and a tail reference, in O(N + M) time. Alternate Node Fusion, Merge Sorted Lists, Merge Sorted Lists II, List Addition.
Reorder
Compose a split on one function with a merge on another to rearrange nodes in place, the most general singly linked list pattern. Relocate Node, Parity Order, Value Partition, Shuffle List.

Each pattern is taught in three layers. An Understanding lesson walks through the technique on a problem where the pattern is obvious. An Identifying lesson teaches you the signals that tell you a new problem fits the template, the same triggers an experienced engineer reads in an interview. Then four problems give you progressively harder applications. The course closes with a design capstone where you implement a singly linked list of your own, with every supported operation written at its tightest complexity and tested against an array-backed reference implementation.

How this course is different

Most linked list resources stop at reversal and cycle detection, treating each subsequent problem as its own one-off trick. This course teaches the seven patterns underneath, so you recognise the template before you write a single pointer assignment.

Most DSA resources
This course
âś—Treat linked lists as a one-page topic before jumping straight to "100 linked list problems".
✓Opens with the node primitive and builds every operation from explicit pointer rewires.
âś—Teach reversal as a single trick, leaving you unable to apply it to pairwise swap or K-segment reversal.
✓Treats reversal as two distinct patterns (direct reversal and reversal as a subproblem) so you can apply it to harder problems.
âś—Cover Floyd's cycle detection in isolation, missing that the same two-speed idea solves middle node and palindrome.
✓Groups middle node, palindrome checking, and cycle detection under one fast-and-slow-pointers family.
âś—Skip the dummy head and tail reference idiom, so merge and split solutions become tangled with edge cases.
✓Teaches the dummy head with tail reference idiom as the unifying device behind split, merge, and reorder.
âś—Stop at the algorithm and never have you implement a singly linked list yourself.
✓Ends with a design capstone where you implement the data structure your standard library hides from you.

Who this course is for

The course suits anyone who has heard the words "linked list" but is not yet confident they could wire one up cleanly under interview pressure.

  • New programmers who can write a for loop but have never traced what node = node.next does to the reference under the variable.
  • Self-taught and bootcamp graduates who solved a few linked list problems on LeetCode but cannot recognise the patterns underneath.
  • Working developers who use ArrayList and HashMap every day and have not written a node-based structure since school.
  • Engineers preparing for FAANG and Big Tech interviews where reversal, cycle detection, and merge questions appear in nearly every onsite.
  • Returning engineers who learned linked lists years ago and want a refresher that goes past the textbook reversal walkthrough.
  • Anyone who can sketch a linked list on a whiteboard but loses the thread when asked to swap two adjacent nodes correctly.

Continue your DSA journey

Linked lists are the gateway data structure for every other pointer-based topic in this curriculum. After this course, your next step depends on whether you want to deepen pointer skills or move into structures that sit on top of linked lists.

  • Array: The contrast course. Arrays and linked lists are the two ways to lay out a sequential collection in memory: contiguous bytes versus pointer-chased nodes. Understanding both is how you can defend your data structure choice in a system design interview.
  • Doubly linked list: The natural continuation. Adding a previous pointer makes several patterns simpler and unlocks new ones (LRU cache, deque, in-place reorder). The pointer hygiene you built here transfers directly, so most learners take this course right after.
  • Stack: A stack backed by a linked list pushes and pops at the head, the same O(1) operation you learned in the insertion lessons. The stack course also uses traversal patterns as a setup for the previous-closest and next-closest families.
  • Queue: A queue is the canonical application of a singly linked list with both head and tail references. Once you have those two pointers, enqueue and dequeue both become O(1) operations, and the standard library queue stops looking like magic.
  • Graph: Adjacency lists, the standard representation for graphs, are arrays of singly linked lists. The traversal habits and pointer hygiene you build here are the same toolkit that powers BFS, DFS, and shortest path on a graph.
  • Recursion: A singly linked list is itself a recursive data structure (a node is either null or a value followed by a smaller linked list). The recursion course teaches the head, tail, and multiple recursion shapes that come up when you solve list problems recursively rather than iteratively.

Frequently asked questions

Code examples use Python for readability, but every concept (node structure, pointer rewires, dummy head idiom) is language-agnostic. The course is equally usable from Java, C++, JavaScript, Go, or any language with object references.
Yes. The course starts from a single node holding a value and a next pointer and builds every operation from there. If you can write a for loop and pass an object into a function, you have everything you need.
There are around 32 lessons and 48 problems across 7 patterns plus a design capstone. Most learners finish the lessons in 12 to 18 hours and need another 20 to 30 hours to solve the problems, depending on prior experience.
The patterns covered (reversal, reversal as a subproblem, sliding window traversal, fast and slow pointers, split, merge, reorder) account for a large share of the linked list questions asked in real onsite loops. You will recognise the template on first read of the problem instead of pattern-matching from memory.
LeetCode shows you problems one at a time with no grouping. This course teaches the seven templates first, then drills problems within each template, so you build pattern recognition instead of memorising 50 individual solutions and hoping the next problem looks similar.
Use a linked list when your workload is dominated by insertions or deletions at the head, or at positions you already hold a reference to, since both run in O(1) time. Use an array (or a dynamic array like ArrayList or vector) when you need random access by index, when you want cache-friendly iteration, or when your inserts and deletes happen mostly at the end. In practice, modern hardware favours arrays for most workloads, so linked lists are a strong fit when you genuinely need O(1) head insertion (LRU caches, queues, undo stacks) rather than as a default container.
A dummy head is a sentinel node placed before the real head of the list, holding no meaningful value, whose only job is to give every "real" node a guaranteed predecessor. The trick is that operations that would otherwise need a special case for the head of the list (insertion, deletion, merging, splitting) become uniform. You always have a predecessor to update, so the code that rewires pointers never has to branch on "is this the head?" The dummy is created at the start of the function, the algorithm runs against dummy.next as the working head, and the return value is dummy.next after the work is done. Merge two sorted lists, partition a list around a value, remove the Nth from end, and reverse a segment all read substantially cleaner with a dummy head than without.
Yes. Once you finish all lessons and the design capstone, codeintuition issues a shareable certificate you can post to LinkedIn or attach to a job application.