Let us create following BST 10 / \ 5 15 / \ \ 3 7 18
Node * root = NULL ; root = insert ( root , 10 ) ; insert ( root , 5 ) ; insert ( root , 15 ) ; insert ( root , 3 ) ; insert ( root , 7 ) ; insert ( root , 18 ) ; int L = 7 , R = 15 ; cout << rangeSumBST ( root , L , R ) ; return 0 ; }