Facebook | Phone Screen | Validate Single Binary Tree
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2019-08-14Added By Anonymous
Source: Link
Meta (Facebook) | Phone Screen | Validate Single Binary Tree
Company: Meta (Facebook)
Role: e3, e4
Stage: Phone Screen
Location: unknown
Year: unknown
You have standard node of node.left node.right and val.
Given a list of nodes (which can be graph, circular, multiple trees) verify if it is a single binary tree. Vals can be duplicate
1
23
Input: [1,2,3]
Output: True
1
23 4
Input: [1,2,3,4]
Output: False