Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
428915 | Information Processing Letters | 2006 | 10 Pages |
Abstract
We consider the following tree-matching problem: Given labeled, ordered trees P and T, can P be obtained from T by deleting nodes? Deleting a node v entails removing all edges incident to v and, if v has a parent u, replacing the edges from u to v by edges from u to the children of v. The existing algorithm for this problem needs O(|T||leaves(P)|) time and O(|leaves(P)|min{DT,|leaves(T)|}) space, where leaves(P) (leaves(T)) stands for the number of the leaves of P(T), and DT for the height of T. In this paper, we present a new algorithm that requires O(|T|min{DP,|leaves(P)|}) time and no extra space, where DP represents the height of P.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics