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
As of July 2020, who among the following was the Director General of Indian Council of Medical Research (ICMR)?
Who won the Startup of the year at the ET Startup Awards 2022?Ā
Average function is listed in the drop-down menu of which of the following tools?
Who was the revenue minister during the reign of Akbar?
On which date was the Goods and Services Tax (GST) implemented in India?
The Is of Doing Business Report does not determine the regulators who affect __________.
Where in India the Red sandalwood are found in abundance?
What was the global Skytrax ranking of Delhi IGI Airport in 2024?
Which of the following ministries has got the extension till 30 September 2023 to the NGOs of ācertain categoriesā?
Which of the following statement is correct about New Parliament building?
(A) A heritage panel comprised of 4 members gave its approval to the...