Skip to main content
. 2021 Nov 27;23(12):1592. doi: 10.3390/e23121592
Algorithm 1 Correct one deletion symbol.
  • Input: 

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

  • Output: 

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

  •  1:

    cj=ei=jn1yi mod 4.

  •  2:

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

  •  3:

    Get the total number of elements of r as r.

  •  4:

    Δ=dRsyn(0xjn1) mod 2n.

  •  5:

    Set j=1.

  •  6:

    while  jn  do

  •  7:

       if Δ<r then

  •  8:

         if k0xjn1(j1)=Δ then

  •  9:

            c=del_correct1(n,a,y,j,cj)

  •  10:

         else

  •  11:

            jj+1

  •  12:

         end if

  •  13:

       else

  •  14:

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

  •  15:

            c=del_correct1 (n,a,y,j,cj)

  •  16:

         else

  •  17:

            jj+1

  •  18:

         end if

  •  19:

       end if

  •  20:

    end while