Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

Students also viewed these Databases questions

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago