seth
BAN USER
Questions (3)
Reputation 235
- 1of 3 votes
AnswersGiven a binary tree, a complete path is defined as a path from root to a leaf. The sum of all nodes on that path is defined as the sum of that path. Given a number K, you have to remove (prune the tree) nodes from the tree which lie on a path having sum less than K.
- seth in India
Note: A node can be part of multiple paths. So we have to delete it only in case when all paths from it have sum less than K.| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - 0of 0 votes
AnswersFind the 3rd closest element in a bst.You will be given a pointer to root and a value within the tree against which the closest has to be figured out. (closeness is in terms of value, not by distance ) and then follow up qn: for finding the kth closest in a bst.
- seth in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures
Page:
1
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.