Question: I need help with the program above in C++ I'm supposed to write a program WITHOUT USING CLASSES. I can only use functions and globals,

I need help with the program above in C++ I'm supposed toI need help with the program above in C++

I'm supposed to write a program WITHOUT USING CLASSES. I can only use functions and globals, so I've been having trouble creating the program above.

I was given multiple different test cases such as the ones down below to test the program

Test case1: 1 2 3 2 4 5 4 0 6 6 0 7 7 8 9 8 0 10 10 0 11 11 12 0 12 13 0 13 14 0 14 0 0 9 15 16 15 0 0 16 0 0 5 17 18 17 19 0 19 0 20 20 0 0 18 0 0 

Test Case 2:

1 2 0 2 3 0 3 0 4 4 5 0 5 0 0

etc.

So if anyone can help me, I would appreciate it.

Node ID Computing the height of a binary tree: Our "dummy" tree structure: (PS: node 1 is the root node) Left Child ID (O means no LC) Right Child ID (O means no RC) which means, given a data like this: 1 2 3 24.5 400 500 306 600 1 2 3 The tree should looks like 2 3 45 0 6 4 5 6 0 0 0 0 0 0 Use the "Divide and Conquer idea" to write a program to find out the height of a binary tree

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!