On the top-down tree inclusion

  • Authors:
  • Yangjun Chen;Yibin Chen

  • Affiliations:
  • Dept. Applied Computer Science, University of Winnipeg, Winnipeg, Manitoba, Canada;Dept. Applied Computer Science, University of Winnipeg, Winnipeg, Manitoba, Canada

  • Venue:
  • ACST'06 Proceedings of the 2nd IASTED international conference on Advances in computer science and technology
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

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|ċ DP) time and O(|T|) extra space, where DP represents the height of P.