Paan's cave

Thoughts about tech & life


Let's not teach linked list first

Let’s not teach linked list first

Let’s not teach linked lists as the first data structure CS students see. Here’s why I think we should start with trees instead. Specifically the binary tree.

The future of LinkStash is Stonks

The first thing should be foundational

When we teach someone their first concept in a subject, it should be something foundational, something that helps build everything that comes after. Think about how we learn to read, we start with the alphabet. It’s not just the simplest thing, it’s the piece that shows up everywhere later on.

With linked lists, we don’t quite get that. Yes, they teach important ideas like recursion, pointers, and dynamic memory, but those same concepts can be taught just as well (and more meaningfully) using a data structure that actually shows up in real systems.Linked lists are a niche case. Binary trees are foundational. They appear in search algorithms, compilers, game engines, filesystems. And they naturally lead to n-ary trees and graphs, instead of being a detour.

Starting with binary trees doesn’t just teach the core concepts needed to understand more advanced topics, it also introduces a data structure that is structurally, conceptually, and practically useful.

But Isn’t Linked List Simpler?

That’s the most common argument I hear: “We teach linked lists first because they’re the simplest dynamic data structure.” And yes, linked lists are simple, in a very narrow, linear sense.

Simplicity alone isn’t a good enough reason to make something the first thing we teach. The first concept should be foundational, not just minimal. It should give students tools they can reuse and build on.

Binary trees aren’t more complex, they’re just broader. You don’t need to learn any new concepts to work with them. You’re still dealing with nodes, references, base cases, and recursion. The only difference is that you now apply the same logic to two children instead of one. Teaching left and right doesn’t double the effort. It’s the same lesson, just with an extra step: “Now do the same thing on the right node.” The mental model doesn’t get more complicated.

In return, you get a structure that’s more intuitive and easier to relate to. Trees look like real-world hierarchies, for example file systems, game objects, organization charts. You don’t get that with a linked list. And you sidestep all those early “what is this even for?” questions that linked lists tend to invite. No one looks at a binary tree and says, “Isn’t this just a weird array?”

And here’s the thing, we’re not just teaching binary trees because they’re easier. Binary trees are not just your “baby’s first tree,” they are not just a stepping stone to more advanced structures. They are useful by themselves, binary trees are used in binary search tree, priority queue, huffman coding tress. These aren’t toy examples just for the classroom, they are real tools used to solve real problems.

And while some might argue that linked lists are just easier overall, easier to draw, easier to code, but that tiny bit of convenience isn’t worth giving up the depth and usefulness that trees offer right from the start.

Summary

I’m not saying we shouldn’t teach linked lists at all, I’m saying they shouldn’t be the first thing we teach in data structures. Binary trees aren’t much more complicated, they’re just a bit broader but they use the same core ideas: nodes, references, recursion, null checks. The difference is that binary trees package those concepts in a way that’s more useful and intuitive and they are far more applicable down the line.