السلام عليكم!
هاهو سؤالى نقلته كما طلبت يا اخ هيثم:
هذه خوارزمية لايجاد جميع تجزيئات المجموعة {n,.......,2,1}ولكن لم استطع فهمها فهلا ساعدتمونى بشرحها تفصيليا.
الخوارزمية:
first subset is x.
next subset after y:
find the last element i not in y (working back form the end.
if theer's no such eelment ,then y was the last subse.
remove from y all elements after i,and add i to y .return this set.
و كذلك الخوارزمية الخاصة بايجاد جميع المجموعات الجزئية من {1,.........,n}و التى رتبتها k:
First subset is
{1,.....,k}
Next subset after Y={y1,....yk} where y1<....<yk;
Find the first i such that yi+1 doesnt belong to Y;
increase`y1`by 1, set yj=j for j<i, and return the new set Y;
this fails if i=k,yk=n, in which case Y={n-k+1,...,n} is the last set.
