DOUBT ON HOW TO MAKE THE TREE

on making tree the root node formed is first element of the array. what to do

hi @devashishbotre95_45ed0bc0d0c42ff0,
We can do it using a single traversal. The idea is to use following BST property. If we do reverse Inorder traversal of BST, we get all nodes in decreasing order. We do reverse Inorder traversal and keep track of the sum of all nodes visited so far, we add this sum to every node.

For implementation difficulty refer https://ide.codingblocks.com/s/654116?_ga=2.195207404.1349480821.1650699623-564174853.1650699623