Question: Algorithms: Gadget Testing A company wants to determine the highest floor of its n - story headquarters from which a gadget can fall without breaking,
Algorithms:
Gadget Testing A company wants to determine the highest floor of its nstory headquarters from which a gadget can fall without breaking, so theyll test this by dropping gadgets and seeing when they break. The company only has one gadget to test with, and if the gadget breaks, it cannot be repaired that is by the time the gadget breaks, they better have the answer to your question.
brute force Design a Theta ntime algorithm to solve this problem. Provide pseudocode or a precise description of your approach. Determine the worstcase efficiency of your algorithm as a function of n the number of stories of the building.
boptimization Now, suppose that the company has two identical gadgets to experiment with identical means that if gadget could survive a fall from floor k then so can gadget and viceversa If one of the gadgets gets broken, it cannot be repaired, and the experiment will have to be completed with the remaining gadget. Use the nd gadget to improve on your algorithm from part a That is design an algorithm that has efficiency better than Theta n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
