Fireship · @fireship
5 wild data structures every developer should know
Uploaded May 15, 2025 · Length 4:30
Summary
This video teaches 5 unusual data structures: B tree, radix tree, rope, Bloom filter, and cuckoo hashing, explaining their use cases and benefits.
- data structures
- b tree
- radix tree
- rope data structure
- bloom filter
- cuckoo hashing
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Anyone who has ever graduated from
- 0:01
kindergarten should know the seven
- 0:03
foundational data structures of computer
- 0:05
science, which include arrays, link
- 0:07
list, hashts, stacks, cues, graphs, and
- 0:10
trees. But if you didn't graduate from
- 0:12
kindergarten, here's a quick crash
- 0:13
course. A data structure is just a way
- 0:15
to organize data in a computer so you
- 0:17
can do CRUD to it efficiently. Create,
- 0:19
read, update, and delete it. An array is
- 0:21
like a row of numbered cubbies. A linked
- 0:23
list is like a treasure map of clues. A
- 0:26
hash table is like a locker with your
- 0:27
name on it. A stack is like a stack of
- 0:29
books. A Q is like a line of kids at the
- 0:31
cafeteria. A graph is a spiderweb. And a
- 0:34
tree is well like a tree. The
- 0:36
programming is all about solving
- 0:37
problems. I've got 99 problems, but a
- 0:40
data structure ain't one. But for some
- 0:41
programmers, data structures do become a
- 0:43
problem. And in today's video, we'll
- 0:45
look at a few unusual situations where
- 0:47
these simple data structures were not
- 0:49
good enough or smart enough to get the
- 0:50
job done. Let's start by talking about
- 0:52
the B tree, not to be confused with a
- 0:54
binary tree. One of the most
- 0:56
exhilarating things that ever happened
- 0:57
in my life was the first time I
- 0:58
implemented a binary search tree, which
- 1:01
prevented my algorithm's time complexity
- 1:02
from going burr, turning O of N squared
- 1:05
into a much faster O of login. But
- 1:07
binary search trees have one problem.
- 1:09
Each node in the tree can only have two
- 1:11
children, which means the depth of the
- 1:12
tree grows rapidly and doesn't scale
- 1:15
very well for things like modern hard
- 1:16
drives with massive amounts of data to
- 1:18
search through. To address this problem,
- 1:20
a long time ago, programmers at Boeing
- 1:22
developed the self-balancing tree or B
- 1:25
tree. Although nowadays, you'll mostly
- 1:26
find B+ trees in file systems and
- 1:29
databases. At a high level, what makes
- 1:31
them special is that each node can have
- 1:32
multiple children of sorted keys. These
- 1:35
are called internal nodes, and they work
- 1:36
like signposts that point to leaf nodes
- 1:39
that hold the actual data or pointers to
- 1:41
data. So, it works kind of like a binary
- 1:43
tree, but greatly reduces the dis IO
- 1:45
operations by cutting down the height of
- 1:47
the tree. Pretty cool. But there are
- 1:49
many other types of trees in nature and
- 1:51
in computers like the radex tree. Like
- 1:53
there are billions of IP addresses in
- 1:55
the world. But have you ever wondered
- 1:56
how computers route between them so
- 1:58
efficiently to make the internet work? A


