(root, tree, queries)
| 49 | } |
| 50 | |
| 51 | function lcaBinaryLifting(root, tree, queries) { |
| 52 | const graphObject = new LCABinaryLifting(root, tree) |
| 53 | const lowestCommonAncestors = [] |
| 54 | for (const [node1, node2] of queries) { |
| 55 | const lca = graphObject.getLCA(node1, node2) |
| 56 | lowestCommonAncestors.push(lca) |
| 57 | } |
| 58 | return lowestCommonAncestors |
| 59 | } |
| 60 | |
| 61 | export default lcaBinaryLifting |
no test coverage detected