Question: write a PSEUDOCODE (do not write a complete code) for fucntion that return the sum of all integer greater than the root of a node
write a PSEUDOCODE (do not write a complete code) for fucntion that return the sum of all integer greater than the root of a node based binary search tree containing integer. your function should return 24 because the root contains 6 and there are 3 nodes with integer greater than 6 (8+7+9=24 ).
6
/ \
2 8
/ \ / \
1 4 7 9
/ \
3 5
+ getItem ( ) : int
+ isLeaf ( ): bool
+ getLeftChildPtr: binary index*
+ getRightChildPtr: binary node*
-finish write Pseudocode in below use functions above
sum(nodePtr: BinaryNode *): int
{
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
