【24h】

Counting Palindromes in Substrings

机译:计数子字符串中的回文数

获取原文

摘要

We propose a data structure and an online algorithm to report the number of distinct palindromes in any substring of an input string. Assume that the string S of length n arrives symbol-by-symbol and every symbol is followed by zero or more queries of the form "report the number of distinct palindromes in S[i..j]". We use O(n log n) total time to process the string plus O(log n) time per query. The required space is O(n log n) in general and O(n) in a natural particular case. As a simple application, we describe an algorithm reporting all palindromic rich substrings of an input string in O(n log n) time and O(n) space.
机译:我们提出了一种数据结构和一种在线算法来报告输入字符串的任何子字符串中不同回文数。假设长度为n的字符串S逐个符号到达,并且每个符号后接零个或多个查询,形式为“报告S [i..j]中不同回文的数量”。我们使用O(n log n)总时间来处理字符串加上每个查询的O(log n)时间。所需空间通常为O(n log n),自然情况下为O(n)。作为一个简单的应用程序,我们描述了一种算法,该算法报告O(n log n)时间和O(n)空间中输入字符串的所有回文丰富子字符串。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号