Data Structures exercises with solutions

60 practice problems from the 19 lessons of the Data Structures 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 22 medium problems 19 hard problems

What a data structure is

3 problems · Read the lesson

Arrays: insert, delete and 2D arrays

3 problems · Read the lesson

Singly linked lists

4 problems · Read the lesson

Doubly and circular linked lists

3 problems · Read the lesson

Stacks

3 problems · Read the lesson

Using stacks: brackets and postfix

4 problems · Read the lesson

Queues

3 problems · Read the lesson

Binary trees

3 problems · Read the lesson

Binary search trees

3 problems · Read the lesson

Heaps and priority queues

3 problems · Read the lesson

Hash tables

3 problems · Read the lesson

Graphs

3 problems · Read the lesson

Graph traversal: BFS and DFS

4 problems · Read the lesson

Choosing a data structure

3 problems · Read the lesson

Data structure bugs

3 problems · Read the lesson

Tries: prefix trees

3 problems · Read the lesson

Disjoint sets (union-find)

3 problems · Read the lesson

Segment trees and Fenwick trees

3 problems · Read the lesson

AVL trees: self-balancing search trees

3 problems · Read the lesson