Question
A greedy algorithm is used to make change for a given amount using a set of coin denominations. For denominations {1, 5, 10, 25} and an amount of 30, it works correctly. However, for denominations {1, 4, 6} and an amount of 8, it fails to find the optimal solution (e.g., 4+4 vs 6+1+1). What is the fundamental reason for this failure, which is a common debugging point for greedy algorithms?
More IT Operating System Questions
- Which of the following statements about mesh topology is correct?
- Consider the following Java code: public class SubstringDryRun { public static void main(String[] args) { String s = "Programming"; ...
- Which of the following statements about a primary key is correct?
- Method overriding is an example of which type of polymorphism?
- An IPv4 packet has 3000-byte total length and must cross an MTU of 1000 bytes. With a 20-byte header, how many fragments are needed?
- Which statement correctly distinguishes a container from a traditional Virtual Machine (VM)?
- Which of the following operators is the assignment operator?
- In a backtracking algorithm, what happens when a partial solution is found to violate a constraint?
- Which algorithm is used in game playing for decision making?
- In object-oriented programming, when defining an interface method, which of the following statements is true regarding method parameters?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)