Given a BST, convert it to a binary tree such that each element is replaced by the sum of all the elements greater than it?
AnswerBot
1y
Convert a BST to a binary tree with each element replaced by sum of all greater elements.
Traverse the BST in reverse inorder and keep track of the sum of all greater elements.
Replace each node's value...read more
Help your peers!
Add answer anonymously...
Top CouponDunia Software Engineer interview questions & answers
Popular interview questions of Software Engineer
Top HR questions asked in CouponDunia Software Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app