// TOPIC

#data-structures

25 articles

Beginner
01

What Is a Data Structure?

A data structure is a deal you strike — you give up something to make one operation fast. Here is the big picture before you dive into any of them.

#fundamentals#data-structures#computer-science
9 min
Beginner
02

Stacks and Queues: Order Matters

Learn LIFO vs FIFO, how the call stack works, and when a stack or queue is exactly the right tool — the two simplest constrained collections in CS.

#stacks#queues#data-structures
8 min
Beginner
03

Trees: When Data Branches

Move beyond flat lists and discover why trees power everything from file systems to databases. Learn nodes, roots, leaves, height, and how a balanced tree buys you O(log n) on a silver platter.

#trees#data-structures#fundamentals
10 min
Beginner
04

Graphs: Everything Is Connected

Graphs model maps, social networks, and dependencies. Learn how nodes and edges work, how to represent them, and what BFS and DFS unlock.

#graphs#data-structures#bfs
10 min
◆◆Intermediate
05

Choosing the Right Data Structure

The meta-skill every engineer needs — a decision framework that maps your dominant operation to the right structure, so you stop guessing and start choosing deliberately.

#data-structures#decision-framework#fundamentals
12 min
◆◆◆AdvancedRedisGoogle
06

Skip Lists: The Structure Redis Chose Over Balanced Trees

Skip lists replace tree rotations with coin flips: expected O(log n) search, insert, and delete in ~40 lines. Why Redis, LevelDB, and Java picked them.

#skip-lists#linked-lists#probabilistic-data-structures
18 min
◆◆IntermediateGoogleAmazon
07

Union-Find (Disjoint Set Union)

Union-Find (disjoint set union) answers 'are these two nodes connected?' in near-constant time. Master path compression, union by rank, and Kruskal's MST.

#union-find#disjoint-set-union#graphs
12 min
◆◆IntermediateGoogleAmazon
08

Tries (Prefix Trees)

How tries (prefix trees) power autocomplete and spell-check — insert, search, and prefix queries all run in O(L) on word length, not dictionary size.

#tries#trees#strings
12 min
BeginnerAmazonGoogle
09

Strings

Strings are immutable arrays hiding an O(n²) concatenation trap. Learn the sliding window, two-pointer, and hashing patterns that crack string interviews.

#strings#arrays#fundamentals
13 min
◆◆◆AdvancedGoogleMeta
10

Segment Trees

Segment trees answer range queries AND handle point or range updates in O(log n) — the structure to reach for when prefix sums aren't enough and you need both reads and writes at scale.

#segment-trees#trees#range-queries
13 min
◆◆IntermediateAmazonGoogle
11

LRU Cache

Implement an LRU cache with O(1) get and put: hash map plus doubly linked list, full Python code, eviction mechanics, and the interview traps.

#lru-cache#hash-tables#linked-lists
13 min
BeginnerAmazonGoogle
12

Hash Sets

A hash set is a hash table with the values ripped out — pure O(1) membership, dedup, and "have I seen this?" tracking. Master it and a whole class of O(n²) problems collapse to O(n).

#hash-sets#data-structures#hashing
12 min
◆◆◆AdvancedGoogle
13

Fenwick Trees (Binary Indexed Trees)

Fenwick trees deliver O(log n) prefix sums and point updates in ~10 lines of code. Master the lowbit trick and know when a BIT beats a segment tree.

#fenwick-tree#binary-indexed-tree#prefix-sums
15 min
BeginnerAmazonGoogle
14

Deques (Double-Ended Queues)

A deque gives you O(1) push and pop from both ends — and the sliding-window-maximum trick that turns O(n²) brute-force problems into clean O(n) solutions.

#deques#queues#stacks
12 min
◆◆◆AdvancedGoogleAmazon
15

Bloom Filters

How a bloom filter answers 'definitely not' or 'maybe yes' in ~10 bits per item: the math behind 1% fpp, working Python code, and production uses.

#bloom-filters#probabilistic-data-structures#hashing
13 min
◆◆◆AdvancedGoogleAmazon
16

Balanced BSTs (AVL & Red-Black Trees)

Balanced BSTs keep height O(log n) on any insert order. See how AVL and red-black rotations work, and why Java TreeMap and C++ std::map run on them.

#trees#binary-search-trees#balanced-trees
14 min
BeginnerAmazonGoogle
17

Stacks

The stack data structure explained from first principles — LIFO semantics, O(1) push and pop, and why it shows up everywhere from your call stack to balanced-parentheses checkers.

#stacks#data-structures#fundamentals
10 min
BeginnerAmazonGoogle
18

Queues and Deques

The queue data structure enforces first in, first out — powering BFS and schedulers. Learn why list.pop(0) costs O(n) and how to get true O(1).

#queues#data-structures#bfs
11 min
BeginnerAmazonMicrosoft
19

Linked Lists

The linked list data structure explained from first principles — nodes, pointers, O(1) insert at a known position, and why arrays still win most of the time.

#linked-lists#data-structures#pointers
13 min
◆◆IntermediateAmazonGoogle
20

Heaps and Priority Queues

Learn how the heap data structure delivers O(1) peek and O(log n) push and pop — the engine behind priority queues, top-K queries, and K-way merges.

#heaps#trees#priority-queues
11 min
◆◆IntermediateGoogleAmazon
21

Hash Tables

The interview MVP. How hash functions turn arbitrary keys into O(1) lookups, what actually happens during a collision, and why "just use a hash map" is usually the right instinct.

#hash-tables#data-structures#hashing
10 min
◆◆IntermediateGoogleMeta
22

Graphs

Learn the graph data structure: adjacency lists vs matrices, BFS and DFS traversal, and the grid-as-graph reframe that cracks whole problem categories.

#graphs#data-structures#bfs
12 min
◆◆IntermediateAmazonMeta
23

Binary Trees and Traversals

Master binary tree traversal — inorder, preorder, postorder, and level-order — and the recursive mindset that makes dozens of tree problems click instantly.

#trees#binary-trees#traversals
12 min
◆◆IntermediateAmazonGoogle
24

Binary Search Trees

The left<node<right invariant gives you O(log n) search, insert, and delete — until the tree degenerates into a linked list. Here's the full picture, including why inorder traversal is a free sort.

#trees#data-structures#binary-search
11 min
BeginnerAmazonGoogle
25

Arrays

The data structure everything else is built on. Why arr[i] is instant, why inserting in the middle hurts, and the handful of patterns that turn arrays into interview wins.

#arrays#fundamentals#data-structures
8 min