Anonymous user
Sorting algorithms/Bubble sort: Difference between revisions
fixed compilation, formatting (see https://github.com/dkandalov/rosettacode-kotlin)
(→{{header|PHP}}: 2 performance changes) |
(fixed compilation, formatting (see https://github.com/dkandalov/rosettacode-kotlin)) |
||
Line 1,842:
{{trans|Java}}
<lang
var changed : Boolean▼
fun <T> bubbleSort(a: Array<T>, c: Comparator<T>) {
do {
changed = false
for (i in 0
if (c.compare(a[i], a[i + 1]) > 0) {
val tmp = a[i]
|