Examples
الترتيب الفقاعي بتبديل الجيران
Bubble sort in Arabic, laid out right to left: neighbours swapped pass by pass until a pass makes no swap, beside the Python code.
This video was made with the Algorithm visuals skill.
- 1:11
- Algorithm visuals
- Narrated by Orus
- Arabic
Made from a prompt
اشرح خوارزمية الترتيب الفقاعي خطوة بخطوة على مثال صغير بلغة Python Video transcript
كيف نرتّب أعدادًا بمقارنة الجيران فقط؟ سنجرّب الترتيب الفقاعي في Python.
هذه 6 أعداد للترتيب. بعد كل جولة يستقرّ أكبر عدد متبقٍّ يمينًا؛ البرتقالي للسطر الجاري، والأخضر للمكتمل.
تبدأ الجولة؛ السطر 6 يقارن 5 و1، فيبدّلهما السطر 7 لأنّ 5 أكبر.
يتجاوز 5 العددين 4 و2، لكنه أصغر من 8 فلا يتبادلان. أيّ عدد سيتحرّك الآن؟
بما أنّ 8 أكبر من 3، يتبادلان، فيستقرّ 8 نهائيًا.
تتكرّر مقارنة الجيران؛ يستقرّ 5، ثم يتبادل 4 و3 ليستقرّ 4.
تمرّ جولة بلا تبديل، فيتوقّف الكود: كل جارَين مرتّبان. لكنّ أسوأ الحالات تحتاج وقتًا تربيعيًا.
هذه نقطة عند n = 6 تمثّل 14 مقارنة؛ والمنحنى التربيعي يبيّن لماذا تصبح المدخلات الكبيرة مكلفة.
إذن رتّبناها بتبديل الجيران المخالفين: 1، 2، 3، 4، 5، 8.
More examples
-
Where the money goes when you buy a $5 coffee A $5 latte split into what it pays for, one hand-drawn picture at a time: ingredients, staff, rent and running costs, the 50¢ left over, and why a quiet day makes every cup carry more rent. 2:14 · English -
Why your stomach gets gassy Where gas comes from, drawn and painted in as it is said: swallowed air, gut bacteria and foods like beans and milk, what normal looks like, what helps, and when to see a doctor. 2:17 · English -
A train’s average speed, then a triangle’s area Two problems on a teacher’s board: the options in a row, every line of working written as it is said, each answer checked before it is drawn. 2:07 · English
Your topic, drawn in about a minute.
Your first 2 videos are free, up to 1 minute each, watermarked. No card required. Full product, every voice and style included.