and with a nave algorithm. We compare the performance of these algorithms as a function of the number of queries performed and the imbalance of the tree. For DAGs, we compare a transitive-closure based algorithm, an intelligent traversal algorithm, and our input-sensitive algorithm that uses LCA in trees. We compare the performance of these algorithms as a function of DAG density. We show that the input-sensitive algorithm outperforms the other two algorithms on all test data. Keywords:...