Question: Suppose you have coins of denominations 1, 3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm NOT produce an optimal answer?
Options
A : 20
B : 12
C : 6
D : 5
Data Structure Coin Change Problem more questions
The transmission coefficient of a wave travelling through two media....
In which of these ranges is the central differencing scheme....
What is the orientation of the Earth’s magnetic axis with....
Find the potential of the function V = 60cos ?/r....
The characteristic impedance of a line having open and short....
Length of spring is 5cm and the pitch measured is....
The maximum impedance of a transmission line 50 ohm and....
In the acoustical design of a hall or an auditorium,....
A two-stage amplifier has an input power of 30?W and....
How many Mangalore tiles are required to cover 1 square....
Data Structure Adjacency List more Online Exam Quiz
Data Structure Breadth First Search
Data Structure Campus Interviews
Data Structure Circular Linked Lists
Data Structure Counting Boolean Parenthesizations
Data Structure Depth First Search
Data Structure Dice Throw Problem