String Matching

Go down

String Matching

Post  Admin on Tue Aug 30, 2011 12:05 pm

Brute Force:

public static int match(String a, String b){
char[] cha=a.toCharArray();
char[] chb=b.toCharArray();
int m=a.length();
int n= b.length();
for(int i=0;i<n-m;i++){
for(int j=0;j<m;j++){
continue nexti;
return i;
return -1;


Posts : 131
Join date : 2011-08-16

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum