Algorithms exercises with solutions

57 practice problems from the 18 lessons of the Algorithms course, in lesson order and from easy to hard inside each lesson. Open a problem, write your code and press Submit: the tests run in your browser and nothing is sent to a server.

19 easy problems 20 medium problems 18 hard problems

Analysing algorithms

3 problems · Read the lesson

Binary search

3 problems · Read the lesson

Bubble, selection and insertion sort

3 problems · Read the lesson

Merge sort

3 problems · Read the lesson

Quick sort

3 problems · Read the lesson

Heap sort and counting sort

3 problems · Read the lesson

Recursion and backtracking

4 problems · Read the lesson

Greedy algorithms

3 problems · Read the lesson

Dynamic programming

3 problems · Read the lesson

Knapsack and longest common subsequence

4 problems · Read the lesson

Topological sort

3 problems · Read the lesson

Shortest paths: Dijkstra and Floyd–Warshall

3 problems · Read the lesson

Minimum spanning trees

3 problems · Read the lesson

Number algorithms

4 problems · Read the lesson

Divide and conquer and the master theorem

3 problems · Read the lesson

String matching: naive search and KMP

3 problems · Read the lesson

3 problems · Read the lesson

Bit manipulation

3 problems · Read the lesson