Skip to content

Latest commit

 

History

History

Check If Binary Tree Has Duplicate Values

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Check if a Binary Tree (not BST) has duplicate values

Input : Root of below tree
         1
       /   \
      2     3
             \
              2
Output : Yes
Explanation : The duplicate value is 2.

Input : Root of below tree
         1
       /   \
     20     3
             \
              4
Output : No
Explanation : There are no duplicates.