← Amazon questions

Determine the diameter of a tree

Filed under Amazon

Given an unsorted array of numbers, construct a height-balanced Binary Search Tree (BST) from the sorted elements, and then find the diameter of the resulting tree. The diameter is the length of the…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.