In this paper, we introduce the notion of Cartesian Forest, which generalizes Cartesian Trees, in order to deal with partially ordered sequences. We show that algorithms that solve both exact and approximate Cartesian Tree Matching can be adapted to solve Cartesian Forest Matching in average linear time. We adapt the notion of Cartesian Tree Signature to Cartesian Forests and show how filters can be used to experimentally improve the algorithm for the exact matching. We also show a one to one correspondence between Cartesian Forests and Schr\"oder Trees.
翻译:本文引入笛卡尔森林的概念,该概念推广了笛卡尔树,以处理部分有序序列。我们证明,解决精确和近似笛卡尔树匹配的算法均可适配用于解决笛卡尔森林匹配问题,且平均时间复杂度为线性。我们将笛卡尔树签名的概念适配至笛卡尔森林,并展示了如何利用过滤器在实验中改进精确匹配算法。此外,我们还证明了笛卡尔森林与施罗德树之间存在一一对应关系。