Something
public text v1 · immutable...
while(1) { //better use counter here instead of scary 1
didswap= 0
for(i=firstoflistbase; i; i= i.next) {
next= i.next
if(i.val > next.val) { swap(i.val, next.val); didswap= 1 }
if(next.next == NULL) break
}
if(didswap == 0) break
}