Jump to content

Sorting algorithms/Cocktail sort: Difference between revisions

m (added a related task.)
Line 46:
L R2,N n
BCTR R2,0 n-1
ST R2,NM1 nm1=n-1
DO UNTIL=(CLI,STABLE,EQ,X'01') repeat
MVI STABLE,X'01' stable=true
Line 61:
ST R5,0(R2) a(i)=r5
ST R4,0(R3) a(i+1)=r4
ENDIF , end if
LA RI,1(RI) i=i+1
ENDDO , end do
Line 76:
ST R5,0(R2) a(i)=r5
ST R4,0(R3) a(i+1)=r4
ENDIF , end if
BCTR RI,0 i=i-1
ENDDO , end do
1,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.