السلام عليكم
شباب ارجوكم محتاج شرح greedy algorithm باللغة العربية
ارجوا الرد في اسرع وقت ممكن
السلام عليكم
شباب ارجوكم محتاج شرح greedy algorithm باللغة العربية
ارجوا الرد في اسرع وقت ممكن
مشكور اخوي dr_abdalrhman على شرحك
اخوي هل يوجد كتاب او منهج شرح greedy algorithm باللغة العربية ؟
لان اريد ان اتعمق بها لان من المواد المقررة علي
واكرر شكري لك
تم تعديل هذه المشاركة بواسطة SQU في 20 سبتمبر 2007 في 20:22
اخوي عندي هذا السؤال كيف هي طريقة حلها ارجوا المساعدة
2. Consider the following problem:
in: array of positive numbers a0, a1, . . . , an−1
an integer M
out: subset of input numbers whose sum is maximal and M
• Assume that we use the following greedy algorithm to find this subset:
sum = 0
repeat
select the largest a_i such that sum + a_i <= M
until there is no such a_i left
Show that this greedy algorithm does not always find an optimal solution.
• Assume that we use the following greedy algorithm to find this subset:
sum = 0
repeat
select the smallest a_i such that sum + a_i <= M
until there is no such a_i left
Show that this greedy algorithm does not always find an optimal solution
.
هذا الموضوع مغلق.