proc put_zero_at_beginning( t is array[1..N] of int) variable i, i0 are int i = 1 i0 = 1 while i <= N and t[i] = 0 do i = i + 1 end while while i <= N do if t[i] = 0 then swap t[i] with t[i0] i0 = i0 + 1 end if end for end proc