Coding

Diameter of a Binary Tree

Find the diameter of a binary tree.

Input: root = [1,2]

Output: 1

Explanation: The longest path is simply the single edge connecting the root node to its only child.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions

Interview question asked to Software Engineers interviewing at Gemini, Jobvite, Carta and other companies. Original question asked: Diameter of a Binary Tree.