Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Bubble sort · ⁨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.

ไทย

บับเบิลซอร์ต

เรียงลำดับอาเรย์เป็นแบบเพิ่มขึ้น in place โดยใช้ bubble sort: เดินผ่านอาเรย์เปรียบเทียบคู่เพื่อนบ้านและสลับหากอยู่ในลำดับที่ผิด หลังการเดินรอบทั้งหมดค่าที่เหลือมากสุดได้ "bubbled" ไปยังส่วนท้ายแล้ว ดังนั้นทำซ้ำจนกว่าทุกอย่างจะเรียงลำดับแล้ว

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP