Why is fail[1] in KMP Algorithm always 0?
This is by definition, since:


  For each position i in pattern P, spi is defined as the length of longest proper suffix of P[1...i] that matches a prefix of P.


So, we can conclude that for i=1 the length of longest proper suffix that matches the prefix is 0 since longest prefix = suffix = EMPTY_STRING.

Visit this page for details.