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]
4 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]4 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
A horse pulls a cart along a road with a force of 550 lbs. If the horse does 2,674,100 ftlbs of work by the time it stops, how f
BartSMP [9]

Answer:

When a horse pull a cart the action is on?

A horse is harnessed to a cart. If the horse tries to pull the cart, the horse must exert a force on the cart. By Newton's third law the cart must then exert an equal and opposite force on the horse. Newton's second law tells us that acceleration is equal to the net force divided by the mass of the system.

Explanation:

5 0
3 years ago
Read 2 more answers
Which 1 of the following did women NOT do during WWII?
Anastaziya [24]

Answer:

Didn't do what, there are no women as answers. Contact me and give me the women.

Explanation:

3 0
3 years ago
Read 2 more answers
At what times should you use your headlights?
SVETLANKA909090 [29]

Answer:

Headlights are required to be used 1/2 hour after sunset to 1/2 hour before sunrise, when windshield wipers are being used, when visibility is less than 1000 feet, or when there is insufficient light or adverse weather.

Explanation:

hope this helps

8 0
3 years ago
Read 2 more answers
Ammonia contained in a piston-cylinder assembly, initially saturated vapor at 0o F, undergoes an isothermal process during which
Rudik [331]

ANSWERS:

-P_{2(a)} =15.6lbf/in^2\\-P_{2(b)} =30.146lbf/in^2\\ T_{2(a)} =0^oF\\T_{2(b)} =0^oF\\x_{2(b)} =49.87percent

Explanation:

Given:

Piston cylinder assembly which mean that the process is constant pressure process P=C.

<u>AMMONIA </u>

state(1)

saturated vapor x_{1} =1

The temperature T_{1} =0^0 F

Isothermal process  T=C

a)

-V_{2} =2V_{1} ( double)

b)

-V_{2} =.5V_{2} (reduced by half)

To find the final state by giving the quality in lbf/in we assume the friction is neglected and the system is in equilibrium.

state(1)

using PVT data for saturated ammonia

-P_{1} =30.416 lbf/in^2\\-v_{1} =v_{g} =9.11ft^3/lb

then the state exists in the supper heated region.

a) from standard data

-v_{1(a)} =2v_{1} =18.22ft^3/lb\\-T_{1} =0^oF

at\\P_{x} =14lbf/in^2\\-v_{x} =20.289 ft^3/kg

at\\P_{y} =16 lbf/in^2\\-v_{y} =17.701ft^3/kg

assume linear interpolation

\frac{P_{x}-P_{2(b)}  }{P_{x}- P_{y} } =\frac{v_{x}-v_{1(a)}  }{v_{x}-v_{y}  }

P_{1(b)}=P_{x} -(P_{x} -P_{y} )*\frac{v_{x}- v_{1(b)} }{v_{x}-v_{y}  }\\ \\P_{1(b)} =14-(14-16)*\frac{20.289-18.22}{20.289-17.701} =15.6lbf/in^2

b)

-v_{2(a)} =2v_{1} =4.555ft^3/lb\\v_{g}

from standard data

-v_{f} =0.02419ft^3/kg\\-v_{g} =9.11ft^3/kg\\v_{f}

then the state exist in the wet zone

-P_{s} =30.146lbf/in^2\\v_{2(a)} =v_{f} +x(v_{g} -v_{f} )

x=\frac{v_{2(a)-v_{f} } }{v_{g} -v_{f} } \\x=\frac{4.555-0.02419}{9.11-0.02419} =49.87%

3 0
3 years ago
A gearbox is needed to provide an exact 30:1 increase in speed, while minimizing the
alekssr [168]

Answer:

answer

Explanation:

4 0
3 years ago
Other questions:
  • A prototype boat is 30 meters long and is designed to cruise at 9 m/s. Its drag is to be simulated by a 0.5-meter-long model pul
    6·1 answer
  • What is an isentropic process?
    7·1 answer
  • A socket can be driven using any of the following except for (A) a socket ratchet
    14·1 answer
  • Find the sum and product of each of these pairs of numbers. Express your answers as a base 3 expansion. Hint: We can just add an
    5·1 answer
  • 13. Write a function which is passed two strings. The function creates a new string from the two original strings by copying one
    13·1 answer
  • If a ball is dropped from a height its velocity will increase until it hits the ground, assuming that aerodynamic drag due to th
    6·1 answer
  • Chad is working on a design that uses the pressure of steam to control a valve in order to increase water pressure in showers. W
    5·1 answer
  • A retail business, owned by share holders and having centralized decision making for their multiple store locations is called:
    13·1 answer
  • A step-up transformer has 20 primary turns and 400 secondary turns. If the primary current is 30 A, what is the secondary curren
    15·1 answer
  • Reason fo I.EE regulations in electrical installations​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!