Question: Problem 1 (48 points): A human pyramid is a formation of people where participants make a horizontal row along the ground, and then additional rows

 Problem 1 (48 points): A human pyramid is a formation ofpeople where participants make a horizontal row along the ground, and then

Problem 1 (48 points): A human pyramid is a formation of people where participants make a horizontal row along the ground, and then additional rows of people climb on top of their backs. Each row contains 1 person fewer than the row below it. The top row has a single person in it. The image below depicts a human pyramid with four rows. Before you decide to participate in one of these, you may want to know how much weight you will be supporting B C DEF G HU Write a recursive program to compute the weight being supported by the knees of a given person in the human pyramid. We will define the weight on a given person Ps knees recursively to be Ps own weight, plus half of the weight on the knees of each of the two people directly above P. For example, in the pyramid figure at right, the weight on the knees of person I below is I's own weight, plus half of the weight on the knees of persons E and F The weight on the knees of persons E and F can be computed recursively using the same process; for example, the weight on the knees of person E is E's own weight, plus half of the weight on the knees of person B, plus half of the weight on the knees of person C. If a given person does not have two people directly above them, any "blank" or "missing" persons should be ignored. For example, the weight on the knees of person F in the figure at right is F's own weight, plus half of the weight on the knees of person C. No truncation/rounding of the result should be done during any of these recursive calculations Sample output

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!