Data structures and algorithms

A free DSA course in Python for beginners: Big-O, arrays, linked lists, trees, graphs, sorting and dynamic programming, with interview problems.

8 modules · 10 lessons so far

Module 1 · Beginner

DSA foundations and complexity

What DSA is, how to measure how fast code runs, and a method for solving any coding problem.

  1. What is DSA? A roadmap for beginners
  2. Big-O notation in Python, with examples
  3. Recursion explained, with Python examples
  4. How to solve coding problems, step by step

Module 2 · Beginner

Arrays, strings and hashing

The patterns behind most interview questions: two pointers, sliding windows, prefix sums and hash maps.

  1. Arrays and Python lists for DSA
  2. Hash maps in DSA: two sum and counting
  3. The two pointers technique, with Python examples
  4. Sliding window technique in Python
  5. Prefix sums explained, with Python examples
  6. String problems: palindromes and anagrams

Module 3 · Beginner

Linked lists, stacks and queues

Data structures built from linked pieces, and the first-in and last-in rules that power them.

  1. Linked lists in Python
  2. Reverse a linked list, and other classic problems
  3. Stacks in Python, with examples
  4. Queues and deques in Python
  5. Monotonic stack problems

Module 4 · Intermediate

Sorting and searching

Find things fast and put them in order, and know which algorithm Python uses.

  1. Binary search explained, with variations
  2. Bubble, selection and insertion sort
  3. Merge sort and quick sort
  4. Sorting in Python: sorted, key and stability

Module 5 · Intermediate

Trees, heaps and graphs

Hierarchies and networks: from binary trees to shortest paths.

  1. Binary trees and tree traversals
  2. Binary search trees
  3. Heaps and priority queues with heapq
  4. Graphs: representation, BFS and DFS
  5. Shortest paths with Dijkstra's algorithm
  6. Tries for word problems

Module 6 · Intermediate

Problem-solving patterns

Strategies for harder problems: try everything smartly, or choose greedily.

  1. Backtracking: subsets, permutations and N-Queens
  2. Greedy algorithms, with examples
  3. Bit manipulation basics

Module 7 · Advanced

Dynamic programming

Solve big problems by remembering the answers to smaller ones.

  1. Dynamic programming for beginners
  2. Memoisation vs tabulation
  3. 1D dynamic programming problems
  4. 2D dynamic programming: grids and strings
  5. The knapsack problem

Module 8 · Advanced

Interview preparation

Practise the problems and habits that coding rounds test.

  1. 75 must-do DSA interview problems
  2. DSA quick reference for Python

Want to learn this with others?

Join our free Python training, run by the theprogrammers community.