Knuthmorrispratt Algorithm Design