Amazon Interview Question
Software Engineer / DevelopersCountry: India
Root node is always less then the right child and so the replacing root to sum of the values will cause a B-tree where right child is less than root
But in Case if left child is negative than only this task feasible resulting in a BST
2 passes:
- Once to replace root when the root > left + right
- else to replace child node
- Ran January 30, 2012