Horspool 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  
G C A G A G A G  

Shift by: 1 (bmBc[A])

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
  2             1  
  G C A G A G A G  

Shift by: 2 (bmBc[G])

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
  2             1  
  G C A G A G A G  

Shift by: 2 (bmBc[G])

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
  2 3 4 5 6 7 8 1  
  G C A G A G A G  

Shift by: 2 (bmBc[G])

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
  1  
  G C A G A G A G  

Shift by: 1 (bmBc[A])

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  
  G C A G A G A G  

Shift by: 8 (bmBc[T])

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
  2             1
  G C A G A G A G

Shift by: 2 (bmBc[G])

The Horspool algorithm performs 17 character comparisons on the example.

Horspool algorithm