البيــــداء
06-12-2007, 12:45 AM
السلام عليكم أنا عضوة جديدة في المنتدى وأتمنى تساعدوني الي يعرف الله يخليكم لايبخل علي وأكون شاكره له
انا معاي خوارزم وابي برنامج لذا الخوارزم موعارفه اكتبه بإستخدام الselection sort
: Simple Selection Sort Algorithm Array_ Based
For i = 0 to n-1 do the following
a- set small pos = i & smallest = x [small pos
: b- For j = i +1 to n-1 do the following
if x [j] < smallest // smaller element found
[ set small pos = j & smallest = x[small pos
End if
End for
Now inter change smallest with x[i] , first Element for this sub list//
c- set x[small pos] = x [i] & x [i] = smalle
End for
انا معاي خوارزم وابي برنامج لذا الخوارزم موعارفه اكتبه بإستخدام الselection sort
: Simple Selection Sort Algorithm Array_ Based
For i = 0 to n-1 do the following
a- set small pos = i & smallest = x [small pos
: b- For j = i +1 to n-1 do the following
if x [j] < smallest // smaller element found
[ set small pos = j & smallest = x[small pos
End if
End for
Now inter change smallest with x[i] , first Element for this sub list//
c- set x[small pos] = x [i] & x [i] = smalle
End for