pattern matching using only character arrays (KMP alg)

pattern matching using only character arrays (KMP alg)

Page 1 of 1

0 Replies - 3645 Views - Last Post: 05 November 2006 - 01:46 PM Rate Topic: -----

#1 johnp585  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-November 06

pattern matching using only character arrays (KMP alg)

Posted 05 November 2006 - 01:46 PM

I am stuck i keep on going around in circles over this... I am trying to write a program that takes two arguments. They are both strings. I need to implement the KMP algorithm or something similar using only character arrays to see if the first string is within the second string. If anybody can help or give me some pointers it would be greatly appreciated.

p.s. I know i can do this, its not sufficient for my problem:

if (args[1].indexOf(args[0]) > 0) {
System.out.println("first string inside the second!");
}

-thanks

Is This A Good Question/Topic? 0
  • +

Page 1 of 1