Search⌘ K
AI Features

Challenge: Tree Depth

Understand how to compute the depth of a binary tree by identifying the longest branch from the root node to any leaf. This lesson guides you through defining tree depth as the number of edges in the longest path, applying it to sample inputs, and encourages hands-on problem solving to reinforce your understanding.

Problem

Given a binary tree, find its depth. The depth of the root is 0. The depth of the tree is the number of edges in ...