Definitionپێناسە
A simple : find the smallest item of the unsorted part, swap it to the front of that part, and repeat with the rest. It needs about comparisons, so it is slow for big lists, but it is easy to follow by hand.
سادەی : بچووکترین بەشە ڕیزنەکراوەکە بدۆزەرەوە، بیگوازەرەوە بۆ سەرەتای ئەو بەشە و بۆ ئەوەی ماوەتەوە دووبارەی بکەرەوە. نزیکەی بەراورد پێویست دەکات، بۆیە بۆ گەورە خاوە، بەڵام بە دەست بەدواداچوونی ئاسانە.
Exampleنموونە
Each pass puts the next smallest number in place.
هەر جارێک ژمارەی بچووکی داهاتوو دەخاتە شوێنی خۆی.
values = [4, 7, -2, 0]
for start in range(len(values) - 1):
m = start
for j in range(start + 1, len(values)):
if values[j] < values[m]:
m = j
values[start], values[m] = values[m], values[start]
print(values) # [-2, 0, 4, 7]Other Kurdish renderings in useوەرگێڕانە کوردییەکانی تر
ڕیزکردن بە هەڵبژاردنی
Note on the Kurdish termتێبینی دەربارەی زاراوە کوردییەکە
The registry's sorting (ڕیزکردن) + «بە هەڵبژاردن» (by selecting), the same shape as the Arabic «الترتيب بالاختيار» that Kurdish students meet in Arabic textbooks. «هەڵبژاردن» alone is already the relational-algebra selection-operation, so the full phrase is used. Proposed.
Related termsزاراوە پەیوەندیدارەکان
Videosڤیدیۆکان
Selection sort step by step: find the smallest remaining value, swap it to the front, repeat — then the same in Python code.
هەنگاو بە هەنگاو: بچووکترین لە بەشی ڕیزنەکراو بدۆزەوە، بە جێگۆڕکێ بیبە بۆ پێشەوە و دووبارەی بکەرەوە؛ پاشان بە کۆدی .