LeetCode 543: Diameter Of Binary Tree — Step-by-Step Visual Trace
Easy — Binary Tree | Depth-First Search | Tree | Recursion
The Problem
Find the diameter of a binary tree, which is the length of the longest path between any two nodes in the tree. The path may or may not pass through the root.
Approach
Use a recurs...
blog.tracelit.dev1 min read