Tree: Depth-First Search - Diameter of Binary Tree
Given the following optimized recursive code snippet to compute the diameter of a binary tree, what is the returned diameter for the tree: root = [1,2,3,4,5] (where 4 and 5 are children of 2)?
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions