A string is closed if , or if has a non-empty border occurring only as its prefix and suffix. A maximal closed substring (MCS) is a maximal occurrence of a closed string; equivalently, it is a maximal closed repeat (MCR). We study MCS enumeration directly from the run-length encoding (RLE) of a string. For a string of length with RLE size , we introduce a compact family representation for all MCS occurrences. We prove that families are always sufficient and sometimes necessary. The representation relies on consecutive occurrence pairs of longest borders, classified by the RLE length of the border. The non-unary non-periodic cases are handled uniformly by a sparse suffix tree on run-start suffixes and height-based three-sided range reporting over RLE-boundary point sets; periodic cases are treated separately. Using McCreight’s balanced priority search trees, the compact representation of all MCSs can be listed in time with working space.

生成讲解博客的中文版本

生成AI智能校验的中文版本