Panopto | Phone | Seattle | Duplicates In Binary Tree
Anonymous User
248

Given a sorted binary tree, please find if any duplicate values exist in the tree. Your function
should take in the root node, and return true as soon as a duplicate is found
Duplicate values may either be on the right or left sub-tree - the ordering is not guaranteed
Examples:

              4                       6                          7
            /   \                   /   \                      /   \
            3    5                 6     6                    7   10 

Follow up: if amount of data is huge - how would you approach a multi-threaded solution?

Comments (2)