Trees coding challenges

Practise trees with 3 coding challenges, from easy to hard. Every challenge runs in your browser with instant tests, an AI review of your code and community solutions to compare.

Medium · 3

Skills you'll practise: Adjacency listsAlpha-beta pruningComposite patternDouble BFSGame searchTrees
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
226
Challenges
2
Solutions shared
3
Languages

All challenges

Search by topic, language, or difficulty.

3 challenges
Medium

Tree Diameter

A tree is a connected undirected graph with no cycles.

You'll learn Double BFSAdjacency lists
GraphsTrees
No solutions yet
Medium

Alpha-Beta Pruning

Evaluate a game tree with minimax and alpha-beta pruning, and count how many leaves the search really looks at.

You'll learn Alpha-beta pruningGame search
RecursionTreesai
No solutions yet
Medium

Composite Folder Sizes

Compute the total size of every folder in a tree where folders contain files and other folders.

You'll learn Composite patternTrees
Design patternsRecursionTrees
No solutions yet