Skip to content

Latest commit

 

History

History
 
 

diameter-of-n-ary-tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

< Previous                  Next >

Hints

Hint 1 For the node i, calculate the height of each of its children and keep the first and second maximum heights (max1_i , max2_i).
Hint 2 Check all nodes and return max( 2 + max1_i + max2_i ).