Question: Consider the following scenario and then develop an algorithm to solve it: a) Suppose you have 9 coins and one of them is heavier than

Consider the following scenario and then develop an algorithm to solve it:

a) Suppose you have 9 coins and one of them is heavier than others. Other 8 coins weight equally. You are also given a balance. Develop and algorithm to determine the heavy coin using only two measurements using the balance.

b) Now, suppose you have n coins and one of them is heavier. You can assume that n is a power of 3. Generalize the algorithm you have developed in part (a) above for this case. What is the running time of your algorithm?

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!