Skip to content · ⁨Lompat ke konten⁩

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.

Bahasa Indonesia

Bubble sort

Urutkan array menjadi urutan naik secara in-place menggunakan bubble sort: jelajahi array membandingkan setiap pasangan tetangga dan tukar jika berada dalam urutan salah. Setelah setiap penuh melewati nilai terbesar yang tersisa telah "melayang" ke akhir, jadi ulangi hingga semuanya terurut.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP