Program to Implement K-Naive Algorithm in Java

class bf_fun
int bf(String t,String p)
int n = t.length();
int m = p.length();
int j=0,flag = 0;

for(int i=0;i<=n-m;i++) { if (p.charAt(j) == t.charAt(i)) { if(m==1) return i+1; for(int k=1;k

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.