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
- A resource-allocation graph contains a cycle, but at least one resource type in the cycle has multiple instances. What can be concluded?
- What is the time complexity for performing enqueue and dequeue operations on a queue implemented using a linked list?
- Which of the following is the best example of Platform as a Service (PaaS)?
- Which of the following is a blueprint for creating objects?
- Which of the following is a non-linear data structure?
- Which CPU scheduling algorithm can cause 'starvation', where longer processes may wait indefinitely because shorter processes are continually given priorit...
- In ___ each address field determines two address fields i.e. either a memory word or the processor register.
- Consider: SELECT DEPT, AVG(SALARY) FROM EMP GROUP BY DEPT HAVING AVG(SALARY) > 50000; If EMP has: IT(60k,45k,70k), HR(55k,40k), Finance(80k) — which outpu...
- Which layer is not in OSI but in TCP/IP
- Average waiting time of all process?
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)