Two Way example


First attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1 2  
G C A G A G A G  

Shift by: 2

Second attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1  
  G C A G A G A G  

Shift by: 1

Third attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1  
  G C A G A G A G  

Shift by: 1

Fourth attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1  
  G C A G A G A G  

Shift by: 1

Fifth attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  7 8 1 2 3 4 5 6  
  G C A G A G A G  

Shift by: 7

Sixth attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1 2  
  G C A G A G A G  

Shift by: 2

Seventh attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1 2  
  G C A G A G A G  

Shift by: 2

Eighth attempt
G C A T C G C A G A G A G T A T A C A G T A C G
  1 2 3  
  G C A G A G A G

Shift by: 3

The Two Way algorithm performs 20 character comparisons on the example.

Two Way algorithm