(root, tree, queries)
| 70 | } |
| 71 | |
| 72 | function binaryLifting(root, tree, queries) { |
| 73 | const graphObject = new BinaryLifting(root, tree) |
| 74 | const ancestors = [] |
| 75 | for (const [node, k] of queries) { |
| 76 | const ancestor = graphObject.kthAncestor(node, k) |
| 77 | ancestors.push(ancestor) |
| 78 | } |
| 79 | return ancestors |
| 80 | } |
| 81 | |
| 82 | export default binaryLifting |
no test coverage detected