• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

WordFinder redux ... String Searching

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The wordfinder puzzle is already gone! I played a bit with a (possibly) faster string searcher. Back in the 80s I remember a lot of excitement about the Boyer-Moore search algorithm. It can be much faster than checking each position for a match, and gets even faster on longer search strings. Here's a description on Moore's Best Ideas page.

Rather than implement Boyer-Moore (which is awfully complicated) I took the first half of the algorithm from memory and made this.

with tester
 
reply
    Bookmark Topic Watch Topic
  • New Topic