Menu

(Solved) : 5 3 Points Consider Hypothetical Country Binary Land Use Coins N Types Coins Denominations Q44115518 . . .

5. (3 points) Consider a hypothetical country Binary Land where they only use coins. There are n types of coins of denominati

5. (3 points) Consider a hypothetical country Binary Land where they only use coins. There are n types of coins of denominations 1, 21, 22, 23, …,2-1Suppose you are a bank teller in Binary Land and your job is to give money to customers for any requested value V that is an integer. You should minimize the number of coins while paying V units of money. Design an algorithm that takes V as input and outputs the payment method that minimizes the total number of coins. Give pseudocode. Prove that your algorithm returns an optimal solution and discuss running time of your algorithm. (The output can be an array containing non-negative integers [S1, S2, …, Sn such that: -1 8-2-1 = V.) Show transcribed image text 5. (3 points) Consider a hypothetical country Binary Land where they only use coins. There are n types of coins of denominations 1, 21, 22, 23, …,2-1Suppose you are a bank teller in Binary Land and your job is to give money to customers for any requested value V that is an integer. You should minimize the number of coins while paying V units of money. Design an algorithm that takes V as input and outputs the payment method that minimizes the total number of coins. Give pseudocode. Prove that your algorithm returns an optimal solution and discuss running time of your algorithm. (The output can be an array containing non-negative integers [S1, S2, …, Sn such that: -1 8-2-1 = V.)

Expert Answer


Answer to 5. (3 points) Consider a hypothetical country Binary Land where they only use coins. There are n types of coins of denom…

OR