Given a tree, flag every node that is an endpoint of some longest path (diameter) in the tree.
Unlock detailed company stats for this questionUpgrade
Given a tree with n numbered nodes and its edge list, return an array of 0/1 flags, one per node, marking every node that is an endpoint of at least one longest path (diameter) in the tree.
Community answers
No answers contributed by the community yet.
Related questions
Print the cousins of a given node in a binary tree.Given the root of a binary tree, return the length of the diameter of the tree.Related courses

Course

