Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6617781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:44:42+00:00 2026-05-25T20:44:42+00:00

EDIT 2: I managed to find the solution with suffix trees Tree::Suffix perl package.

  • 0

EDIT 2: I managed to find the solution with suffix trees Tree::Suffix perl package. Thanks to MarcoS for the trie idea. I figured out from that, that suffix trees could be used as well. The Tree::Trie perl package is implemented as hash of hashes and I guess that’s the reason it slow. I tried it and then went back to Tree::Suffix. Thanks to all others for their links to different algorithms. I am already trying to write code for every algorithm mentioned here myself as a learning process

EDIT 1: I changed the title from perl string-match problem to string-match problem.

Suppose that I have two strings, say,
S1 = ACGAGGATAGTATGCCACACAATGAGTACCCGTAC
S2 = CAGTATTGCACGTTGTAAAGTTACCCAGGTACGATGACAGTGCGTGAGCATACGAGGATAGTATGCCA

I initially wanted to check for the occurrence of string S1 (with no or 1 mismatch) in S2. And I have already written the perl code for that.

Now, I would like to develop on it to

1) Search for k-mismatches of S1 in S2.
2) Search for the occurrence of a prefix (yes, prefix, not suffix), of S1 in S2. If you look at the example, the string: ACGAGGATAGTATGCCA occurs at the end of S2 which is the beginning of S1.
3) If possible, search for the prefix with k-mismatches.

The catch is that I have about 100 million such S2 strings. S1 however remains the same and is of a defined constant length for a given problem. Is there an efficient algorithm in the literature that I could use for this problem of mine?

S1 varies between 50 and 80 characters. Also, I am mostly interested in solving problem 2 at first.

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:44:43+00:00Added an answer on May 25, 2026 at 8:44 pm

    You may be able to modify the Aho-Corasick algorithm for your purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This question is a duplicate of What is the difference between managed and
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
I have to figure out an algorithm, which finds a solution for the Connect
I've had a look around but haven't managed to find what I'm looking for.
I've looked into a couple of posts, but couldn't find a working solution. My
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT What small things which are too easy to overlook do I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.