 Tarjan's off-line lowest common ancestors algorithm, for example, preprocesses a tree in linear time to provide constant-time LCA queries.In general DAGs, similar algorithms exist, but with super-linear complexity.The lowest common ancestor problem was defined by , but were the first to develop an optimally efficient lowest common ancestor data structure.