类 LongestRepeatedSubstring


  • public class LongestRepeatedSubstring
    extends java.lang.Object
    The LongestRepeatedSubstring class provides a SuffixArray client for computing the longest repeated substring of a string that appears at least twice. The repeated substrings may overlap (but must be distinct).

    For additional documentation, see Section 6.3 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

    See also LongestCommonSubstring.

    • 方法概要

      修饰符和类型 方法 说明
      static java.lang.String lrs​(java.lang.String text)
      Returns the longest repeated substring of the specified string.
      static void main​(java.lang.String[] args)
      Unit tests the lrs() method.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • lrs

        public static java.lang.String lrs​(java.lang.String text)
        Returns the longest repeated substring of the specified string.
        参数:
        text - the string
        返回:
        the longest repeated substring that appears in text; the empty string if no such string
      • main

        public static void main​(java.lang.String[] args)
        Unit tests the lrs() method.
        参数:
        args - the command-line arguments