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

  • SEARCH
  • Home
  • 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 8499067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:34:13+00:00 2026-06-11T00:34:13+00:00

Say I have the text abcabx. I would like to know that there is

  • 0

Say I have the text “abcabx”. I would like to know that there is a repeated pattern “ab”, all the locations it appears, and how the context of those repetitions relates to its other occurrences. I also want the data structure to have the unique patterns “c” and “x” distinguished and isolated. I have setup a suffix tree in attempt to do so, and it looks like this (from this SO answer):

abcabx

This does indeed tell me that the pattern “ab” appears twice, once with the suffix “cabx” and another with “x”. However, the “ab” at root only points to the first occurrence of the pattern. It also has another “ab” embedded in its leaf “cabx”, when I’d want that “ab” (in the “cabx”) to somehow be acknowledged as a repeat in the data structure. I know that the “x” leaf of the root “ab” represents it, but I need to know, in the “cabx” leaf of “ab”, that there is an “ab” in there. Plus that two unique patterns, “c” and “x”, are part of that edge. Plus their locations in that edge, and a cross-reference between their “main definitions” (root edges?). It seems that such things could be figured out by iterating around the tree and putting it together, but I need a data structure that stores this information out-right.

To maybe put it simpler, the data structure needs to clearly say “here are all the unique patterns”, “here are all the repeated patterns and every place they happen at”, and “here is the context that relates all of these things”.

So I guess I’m looking for a graph-like element to the suffix tree, something that will partition out known patterns and relate them explicitly. In the process, patterns that are unique would be noted. But I still want the contextual features of the suffix tree, such as saying both “c” (not “cabx”, but “c”) and “x” came after “ab”, “abx” came after “abc”, what came after them (in larger cases), etc. Is there an adaptation of the suffix tree that does this, or perhaps another algorithm?

  • 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-06-11T00:34:14+00:00Added an answer on June 11, 2026 at 12:34 am

    Suffix tree basically just stores all the suffixes of a string in a fashion which makes it easy to search for substrings. Each substring that is repeated more than once will correspond to exactly one non-terminal node. It is relatively easy to find the context in which the pattern appears — if you count the number of symbols in each branch it will give you the offset of the substrings end from the end of the sequence, e.g. there’re two branches from ab, one of length 1 and one of length 4, so you know that the pattern appears 3 and 6 symbols from the end of the string, or 3 and 0 from the beginning.

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

Sidebar

Related Questions

Let's say I have some text that has the pattern as shown by the
Say I have a text file that looks like this: date 1/1/2010 a,b,c a,b,d
Say I have a text file that looks like this (including the filename matches
Let's say I have text like: <p>There are many people in Asia.</p> I want
For example, say I have a text file example.txt that reads: I like dogs.
Let's say I have a text file that is 100 lines long. I want
Let's say I have some original text: here is some text that has a
Say I have a text file formatted like this: 100 20 the birds are
Let's say I have a text file composed like this ##### typeofthread1 ##### typeofthread2
basically have two questions. 1. Is there a c++ library that would do full

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.