Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is only one difference between implicit suffix tree and explicit suffix tree: it does not contain end-of-string markers (and does not contain any branches corresponding to these end-of-string markers).</p> <p>This means there is no difference where to search for a substring - in implicit suffix tree or in explicit suffix tree. Since implicit suffix tree contains less unnecessary branches, this guarantees even more efficient (but still linear-time) algorithm for substring search.</p> <p>So requirement #1 is satisfied automatically: just search suffix tree from the root and choose branches that match given word.</p> <p>As for requirement #2, I think, you cannot satisfy it with the same implicit suffix tree. Because you need end-of-string markers to work with suffixes.</p> <p>But you could do it in <code>O(|U|)</code> time with separate (explicit) suffix tree for given word <code>U</code>. The trick is to reverse this word prior to constructing its suffix tree. To find the longest suffix of <code>S</code> that is also a prefix of <code>U</code>, use this separate suffix tree to find the longest prefix of the reversed string <code>S</code> that is also a suffix of the reversed string <code>U</code>. Just search this suffix tree from the root, choose branches that match the reversed string <code>S</code>, and remember the latest node with end-of-string marker. Then reverse the string on the path from root to this node (or determine length of this path and copy substring of the same length from the tail of <code>S</code>).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload