Zemkvadrātisks algoritms koku ceļu apakšvirkņu uzdevumam
Author
Zajakins, Aleksejs
Co-author
Latvijas Universitāte. Datorikas fakultāte
Advisor
Vihrovs, Jevgēnijs
Date
2021Metadata
Show full item recordAbstract
Darbā tiek apskatīts garākās kopīgās apakšvirknes uzdevuma vispārinājums uz kokiem. Tiek apskatīti divi vienāda izmēra koki, kuru virsotnes ir marķētas ar vienas kopas elementiem. Garākā kopīgā apakšvirkne tiek meklēta pāri visiem ieejas koku ceļu pāriem. Galvenais rezultāts ir algoritms, kas risina apskatīto uzdevumu laikā $O(n \log^3 n)$, kur $n$ ir abu ieejas koku virsotņu skaits. In this work we consider a generalization of the longest common subsequence problem to trees. We examine two equally sized trees with the vertex labels in a common set. Specifically, we solve the problem of finding the longest common subsequence among all pairs of the input tree paths. The main result is an algorithm which solves the considered problem in $O(n \log^3 n)$ time, where $n$ is the number of vertices in both input trees.