MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / constructor

Method constructor

Graphs/LCABinaryLifting.js:12–17  ·  view source on GitHub ↗
(root, tree)

Source from the content-addressed store, hash-verified

10
11class LCABinaryLifting extends BinaryLifting {
12 constructor(root, tree) {
13 super(root, tree)
14 this.depth = new Map() // depth[node] stores the depth of node from root
15 this.depth.set(root, 1)
16 this.dfsDepth(root, root)
17 }
18
19 dfsDepth(node, parent) {
20 // DFS to find depth of every node in the tree

Callers

nothing calls this directly

Calls 2

dfsDepthMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected