Junior software developer interview questions shared by candidates
count the number of duplicates in a binary tree in O(n) time O(1) space.
In order traversal passing down the parent key value to the right child and the previously passed value to the left child, checking for duplicates and adding one to the returned value as you go along.
there is no such info left-right-parent comparision info in a *BT*. I think you are talking about *BST*...
yes you are correct, I meant a BST
See Interview Questions for Similar Jobs
- Software Engineer
- Software Developer
- Junior Software Engineer
- Junior Developer
- Senior Software Engineer
- Software Development Engineer
- Java Developer
- Entry Level Software Engineer
- Associate Software Engineer
- Software Engineer Intern
- Web Developer
- Software Engineer I
- Junior Java Developer
- Business Analyst
- Senior Software Developer
- Associate Software Developer