Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started