Skip to content · ⁨الانتقال إلى المحتوى⁩

Bubble sort · ⁨ترتيب الفقاعات⁩

English

Bubble sort

Sort an array into ascending order in place using bubble sort: walk through the array comparing each pair of neighbours and swapping them if they're in the wrong order. After each full pass the largest remaining value has "bubbled" to the end, so repeat until everything is sorted.

العربية

ترتيب الفقاعات

رتب مصفوفة ترتيبًا تصاعديًا في الموقع باستخدام الفرز الفقاعي: مرر عبر المصفوفة مقارنًا كل زوج من الجيران وتبديلهم إذا كانوا في ترتيب خاطئ. بعد كل مرور كامل، "يطفو" أكبر قيمة متبقية إلى النهاية، لذا كرر العملية حتى يتم ترتيب كل شيء.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP