This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WordFinder redux ... String Searching  RSS feed

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!