Skip to main content
Diameter of Binary Tree | AlgoCracked
AlgoCracked
ProblemsDiameter of Binary Tree
Easy58.0% acceptance
Blind75TreeDfs

Diameter of Binary Tree

The diameter of a binary tree is the number of edges on the longest path between any two nodes; it need not pass through the root. Return the diameter. Input format Level-order JSON array with nulls, e.g. [[1,2,3,4,5]] . TreeNode is predefined.

Loading workspace…