Data Structures & Algorithms

Common ways to organise data and solve problems efficiently.

Data structures are ways to organize data, and algorithms are step-by-step methods for working with it. This track covers Big-O, arrays, hash maps, stacks, queues, recursion, trees, graphs and sorting, with Python examples that apply to any language.

  • Intermediate
  • 9 lessons
  • Runs in your browser
Not started yet
Start lesson 1

Lessons

  1. Big-O: Measuring SpeedBig-O notation describes how an algorithm's work grows as its input grows. You'll use it throughout this track to compare data structures and algorithms.
  2. Arrays & StringsAn array stores items in a row, side by side in memory. You'll learn which operations are fast or slow on arrays and strings, and two common patterns for working with them.
  3. Hash Maps & SetsA hash map lets you look up a value by its key in O(1) time. You'll learn how it works and how it often turns slow nested-loop code into a single pass.
  4. Stacks, Queues & Linked ListsStacks (last in, first out) and queues (first in, first out) control the order items come back out. You'll also see the linked list, which is often used to build them.
  5. RecursionA recursive function calls itself on a smaller piece of the problem until the piece is small enough to answer directly. The next two lessons, on trees and sorting, rely on it.
  6. Trees & Binary SearchA tree arranges nodes in a hierarchy with one root and no cycles. You'll learn how programs store things like folders, the DOM and database indexes, and how binary search works.
  7. Graphs: BFS & DFSA graph is a set of nodes connected by edges, with no required hierarchy. You'll learn to represent one and explore it with breadth-first and depth-first search.
  8. Sorting: How & WhenYou'll see how the classic sorting algorithms work and why the fast ones are O(n log n). In practice you'll call your language's built-in sort, and this lesson shows how to use it well.
  9. DSA CheatsheetEvery structure, its costs, and when to reach for it — one page.

Install it on your own computer

The examples use Python because it is easy to read, but the ideas work the same in any language. If you already set up Python you are ready; otherwise install it and run the examples from a file or the REPL. You do not need this to follow the lessons: the examples run in your browser.

Bash
winget install Python.Python.3.12

# verify:
python --version

# run examples:
python dsa_practice.py

What people build with Data Structures & Algorithms

Learn the basics first, then pick up these tools when a project needs them.

Practical uses

  • Choose efficient representations for real data
  • Reason about performance and scalability
  • Implement search, scheduling, and routing
  • Prepare for technical interviews thoughtfully

Projects to try

  1. Visual sorting explorer
  2. Autocomplete trie
  3. Route planner with Dijkstra
  4. Mini search engine with inverted index

Common tools and packages

VisuAlgoLeetCodeHackerRankGraphvizJupyterBig-O Cheat SheetNetworkXBenchmark tools

Well-known software

Database indexesGPS routingSearch enginesCompilersCompression toolsRecommendation systems