We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS502 GDB NO 1

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 2778

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

Complete solution of this GDB is in lecture no 23.

if u make it plz share

3600

1) 3 - 1000Rs

2) 1 - 500Rs

3) 1 - 100Rs

it requires 5 coinz...

solution... bta do....

jldi kar do share bachon  jisko b ata hai :( mjy to zra nai i smj iski

greedy  approach will be the most appropriate

i think dynamic is best. is it?

Greedy Approach is Best check lecture no 23 and after reading that lecture you will be able to solve this GDB. its too easy.

you cannot say it in particular it depends on the problem sometimes even the complexity may vary even in DP  problems , based on whether you use top-down or bottom -top approach . But one key way to find out is that when you just have more overlapping sub problems and you again and again recompute the values for the same this can be spotted once you construct the decision tree for your problem and then proceed if you can just avoid the overlapping by just using the best (min or max) then your about to use a greedy approach on the other hand you will spot sometimes ... this doesn't work for many problems then you tend to eliminate by just hashing for the previous computed values for some sub problems that can be used in future and voila you are using a DP and it can further go on from one's perspective of viewing the DP problem , one may go top-bottom and recursively solve it while some professionals do this in bottom-top approach where they know what is really going on in that situation.

and it is just an idea or helping lines

upward para is copied from this link which is wrong

Programming Interview_Algorithm_Dynamic Programming_ Coin Changing ...

because the optimum solution of our GDB is greedy algorithm coin change problem which lesson no 23 chapter 7 greedy algorithm

Algorithm work by using time and space ,  use  od algorithm is varied acceding to the situation when we want speed and don’t care space we will go for the faster solution , if we have concern of space we will go for the algorithm which uses less data.

Greedy strategy  is best for  coin change problem because when we have 5000, 1000,500,100 currency notes we want the minimum number of notes to be used to withdraw 3600 .

In this problem 5000 cannot be used after this 1000 can be used 3 times  (keeping in mind we want minimum number of notes )and 500 plus 100 each one time . in this problem greedy strategy is best to reduce the no of notes to minimum that is 5

3 x 100

1x 500

1x 100

Total 5 notes

Hence best solution is greedy algorithm

Algorithm work by using time and space ,  use  od algorithm is varied acceding to the situation when we want speed and don’t care space we will go for the faster solution , if we have concern of space we will go for the algorithm which uses less data.

Greedy strategy  is best for  coin change problem because when we have 5000, 1000,500,100 currency notes we want the minimum number of notes to be used to withdraw 3600 .

In this problem 5000 cannot be used after this 1000 can be used 3 times  (keeping in mind we want minimum number of notes )and 500 plus 100 each one time . in this problem greedy strategy is best to reduce the no of notes to minimum that is 5

3 x 100

1x 500

1x 100

Total 5 notes

Hence best solution is greedy algorithm

## Latest Activity

4 minutes ago
Alone Struggler liked + "αяsαℓ " Ќąƶµяɨ •"'s discussion cut, copy, & paste
6 minutes ago
8 minutes ago
Alone Struggler liked ♦_"Tooba"_♦'s discussion "Don't cry at your loss"
8 minutes ago
Alone Struggler liked ♦_"Tooba"_♦'s discussion "Trust"
10 minutes ago
Alone Struggler replied to ♦_"Tooba"_♦'s discussion "Trust"
10 minutes ago
Alone Struggler liked ♦_"Tooba"_♦'s discussion "Trust"
12 minutes ago
13 minutes ago
14 minutes ago
Alone Struggler liked ♦_"Tooba"_♦'s discussion Maafi
14 minutes ago
Alone Struggler replied to ♦_"Tooba"_♦'s discussion Maafi
14 minutes ago
Alone Struggler liked ♦_"Tooba"_♦'s discussion Maafi
19 minutes ago

1

2

3