If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.’ “ Mark Minasi

Add all greater values to every node in a given BST

Language Java | Level Intermediate | Category Data structure | September 6, 2015 8:09 am


Data structure Description

Given a Binary Search Tree, modify it so that all greater values in the given BST are added to every node.


Output

   					 

All Binary Tree Values: 1  2  3  4  
All Binary Tree Values After modify: 3  2  3  4  

				    

Comments


No comments available!

Please login to add comments.