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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!