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?Solution
The correct answer is B
Which artisan from Chhattisgarh received the National Handicrafts Award for 2023?
In which year was the World Bank established?
The Ganga Expressway inaugurated by PM Modi in Hardoi is how many kilometers long?
Which country is ranked first for cyberattacks in 2024, according to the CloudSEK report?
In July, the number of total account holders under the PMJDY reached 495.6 million, with a total outstanding of over Rs 2 trillion. Of this, _______ are...
Under which legislation were the violations by Reliance General Insurance detected during inspection?
In which Indian state is the Pench Tiger Reserve (PTR) located, recently designated as India's first Dark Sky park?
In a significant development, India is believed to have placed a funding request of around_____Β in its first call with the Pandemic Fund of the World ...
Bangladesh became the first South Asian country to join which UN water governance treaty in 2025?
On which date will the President of India attend the SOAR β Skilling for AI Readiness programme?