Question
Which of the following properties must a problem exhibit
to be solvable by a greedy algorithm?Solution
Greedy algorithms work by making locally optimal choices at each step with the hope that these choices will lead to a globally optimal solution. This requires two properties:   1. Greedy Choice Property: A globally optimal solution can be arrived at by making a locally optimal (greedy) choice.   2. Optimal Substructure: An optimal solution to the problem contains optimal solutions to its subproblems.
P started a business with an investment of Rs.10000, after 6 months Q joined him with Rs.14000 and after another 6 months R joined them with Rs.18000. I...
Aman invested Rs. x at 9% per annum simple interest for 4 years and Neha invested Rs. (x + 800) at 12% per annum simple interest for 1 year. If the tota...
Aman, Bhanu, and Chetna joined a business, investing Rs. 1200, Rs. 1600, and Rs. 'r', respectively. After 6 months, Aman, Bhanu, and Chetna increased th...
"Pawan" and "Qureshi" start a business by investing Rs. 'p' and Rs. 'q', respectively. After the first 6 months, "Pawan" raises h...
A and B started a business with investments of Rs. 36000 and Rs. 48000 respectively. After 4 months, A doubled his investment. If the total profit at th...
A, B and C invest in a partnership in the ratio 7:4:9 and investment of A is Rs.200 less than investment of C. Partner B invests for 1/5th and A and C i...
P started a business investing Rs.10000. After 5 months, Q joined her with the capital of Rs.20000. After another 3 months, R joined them with the capit...
A, B and C enter into a partnership, A invest X + 10000, B invest 3X + 13000 and C invest X + 15000 for one year if B share is 40000 from total profit o...
The collective income of 'D', 'E', and 'F' is Rs. 15000. They spend 55%, 60%, and 50% of their incomes respectively, and their savings are in the ratio ...
P and Q started a business by investing Rs. 10,000 and Rs. 15,000 respectively. p also worked as the active manager and for that he is entitled to recei...