1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alexus [3.1K]
3 years ago
15

typedef struct bitNode { int data; struct bitNode *left; struct bstNode *right; } bstNode; int solve(bstNode* root) { if (root =

= NULL) return 0; int res = root->data; int left = solve(root→left); int right = solve(root->right); if (left+right > res) res = left+right; printf("%d,", res); return res; }_____ , _____ , _____ , _____ ,_____ , _____ , _____ , _____ , _____ , _____
Engineering
1 answer:
Sergio039 [100]3 years ago
4 0

Answer:

The ten numbers to be filled in the blanks are: 18, 7, 7, 11, 18, 36, 3, 8, 13, 50.

Explanation:

keeps on going to the left node until node->left == NULL;

now at Node 18;

left = right = 0; hence condition is not satisfied

18 is printed first.

the value 18 is returned .

Then we reach at 4;

from there we move to 7;

just like 18, similar things happen with 7 and 7 is printed, the value 7 is returned.

Now coming to Node 4,

left = 0, right = 7 ; hence the condition is satisfied & res = 7; 7 is printed.

For Node 16, left = 7 ; right = 11(but for this we visit 11 first and 11 is printed)

for 16; condition is satisfied; res = 7 + 11 = 18 ; 18 is printed

Now for 5; left = right = 18; the condition is satisfied; so res = 18 + 18 = 36; 36 is printed

Next we visit Node 3; 3 is printed & 3 is returned

Then Node 8 ; 8 is printed & 8 is returned

for Node 13; left = 3, right = 8 ; condition is not satisfied, 13 is printed.

For Node 50; left = 36 right = 13 ; condition is not satisfied hence 50 is printed.

So the order of printing is  18 7 7 11 18 36 3 8 13 50.

You might be interested in
2. When it comes to selling their crop, what are 3 options a farmer has when harvesting their grain?
tiny-mole [99]

Answer:

Sell his crop, use his crop as food, and sell his crop

Explanation:

6 0
2 years ago
Which of the following conditions is a good sign of minor
Kryger [21]

Answer:

Explanation:

d

7 0
3 years ago
If you need to write a function that will compute the cost of some candy, where each piece costs 25 cents, which would be an app
masya89 [10]
The best answer would be

D. Int calculateCost(int count);
6 0
2 years ago
Are you?
Inessa [10]

Answer:

are you wht

didn't understand the question

6 0
2 years ago
Read 2 more answers
Inspections may be_____ or limited to a specific area such as electrical or plumbing
Nuetrik [128]
A is the answer for the sentence
4 0
3 years ago
Other questions:
  • Primary Creep: slope (creep rate) decreases with time
    10·1 answer
  • Technician A says that thrust angle refers to the direction the front wheels are pointing. Technician B says that scrub radius r
    11·1 answer
  • The current in a 20 mH inductor is known to be: 푖푖=40푚푚푚푚푡푡≤0푖푖=푚푚1푒푒−10,000푡푡+푚푚2푒푒−40,000푡푡푚푚푡푡≥0The voltage across the induct
    15·1 answer
  • Design a PLC ladder logic program to control the operation of a conveyor-storage system using the following sequence: - 1. Progr
    5·1 answer
  • One of our wifi network standards is IEEE 802.11ac. It can run at 6.77 Gbit/s data rate. Calculate the symbol rate for 801.11ac
    5·1 answer
  • A hydraulic cylinder has a 125-mm diameter piston with hydraulic fluid inside the cylinder and an ambient pressure of 1 bar. Ass
    8·1 answer
  • Direction: List down or enumerate the type of outlets you want to install on your dream house. Also indicate the quantity (in pi
    9·1 answer
  • Planetary gears require the armature to be offset via a gear housing that holds the starter drive.
    12·2 answers
  • What are the horizontal structures beneath a slab that help transfer the load from the slab to the columns?
    14·2 answers
  • When converting liquid level units to sensor output signal units, you should first convert the liquid level units to _____ units
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!