string matching algorithm:RK & KMP