Skip to main content
. 2021 Nov 27;23(12):1592. doi: 10.3390/e23121592
Algorithm 2 Correct two consecutive deletion symbols
  • Input: 

    n,d,a,e,y=cjn2F4n2.

  • Output: 

    c=(c1,c2,,cn)C(n,4).

  •  1:

    cj+cj+1=ei=jn2yi mod 4.

  •  2:

    Get the binary sequence 0xjn2 and the run-length vector r of 0xjn2.

  •  3:

    Get the total number of elements of r as r.

  •  4:

    Δ = dRsyn(0xjn2) mod 2n.

  •  5:

    Set j=1.

  •  6:

    if  Δ2r then

  •  7:

       while jn1 do

  •  8:

         if mod(Δ,2)=1 then

  •  9:

            if 2k0xjn2(j1)+2(nj)+1=Δ then

  •  10:

              xj=x¯j1; xj+1=xj1

  •  11:

              c = del_correct2(n,a,y,j,xj,xj+1,cj+cj+1)

  •  12:

            else

  •  13:

              jj+1

  •  14:

            end if

  •  15:

         else

  •  16:

            if 2k0xjn2(j1)+2(nj)=Δ then

  •  17:

              xj=x¯j1; xj+1=x¯j1

  •  18:

              c = del_correct2(n,a,y,j,xj,xj+1,cj+cj+1)

  •  19:

            else

  •  20:

              jj+1

  •  21:

            end if

  •  22:

         end if

  •  23:

       end while

  •  24:

    else

  •  25:

       while jn1 do

  •  26:

         if mod(Δ,2)=1 then

  •  27:

            if 2k0xjn2(j1)+1=Δ then

  •  28:

              xj=xj1; xj+1=x¯j1

  •  29:

              c = del_correct2(n,a,y,j,xj,xj+1,cj+cj+1)

  •  30:

            else

  •  31:

              jj+1

  •  32:

            end if

  •  33:

         else

  •  34:

            if 2k0xjn2(j1)=Δ then

  •  35:

              xj=xj1; xj+1=xj1

  •  36:

              c = del_correct2(n,a,y,j,xj,xj+1,cj+cj+1)

  •  37:

            else

  •  38:

              jj+1

  •  39:

            end if

  •  40:

         end if

  •  41:

       end while

  •  42:

    end if