Given Tree
Node * root = newNode ( 3 ) ; root -> left = newNode ( 4 ) ; root -> right = newNode ( 6 ) ; root -> right -> left = newNode ( 4 ) ; root -> right -> right = newNode ( 5 ) ; root -> left -> left = newNode ( 10 ) ; root -> left -> right = newNode ( 2 ) ; int max_v = 0 ; int rootIndex = -1 ;