Module: NodeExtensions
- Included in:
- Node
- Defined in:
- lib/visitor/numbering_visitor.rb
Overview
monkey patching dfsNumber and numberNodesInSubtree
Instance Attribute Summary collapse
-
#binaryTreeHeight ⇒ Object
numberNodesInSubtree detects proper ancestor of two nodes, where ancestor is lca binaryTreeHeight is required for building runs.
-
#dfsNumber ⇒ Object
set by first pass traversal with NumberingVisitor.
-
#numberNodesInSubtree ⇒ Object
numberNodesInSubtree detects proper ancestor of two nodes, where ancestor is lca binaryTreeHeight is required for building runs.
-
#runBits ⇒ Object
set by third pass with RunBitVisitor, sets bits for each ancestor run.
-
#runHead ⇒ Object
set by second pass traversal with IvVisitor, a run is the path with a single (lowest in tree) node with the greatest binaryTreeHeight.
-
#runTail ⇒ Object
set by second pass traversal with IvVisitor, a run is the path with a single (lowest in tree) node with the greatest binaryTreeHeight.
Instance Attribute Details
#binaryTreeHeight ⇒ Object
numberNodesInSubtree detects proper ancestor of two nodes, where ancestor is lca binaryTreeHeight is required for building runs
11 12 13 |
# File 'lib/visitor/numbering_visitor.rb', line 11 def binaryTreeHeight @binaryTreeHeight end |
#dfsNumber ⇒ Object
set by first pass traversal with NumberingVisitor
7 8 9 |
# File 'lib/visitor/numbering_visitor.rb', line 7 def dfsNumber @dfsNumber end |
#numberNodesInSubtree ⇒ Object
numberNodesInSubtree detects proper ancestor of two nodes, where ancestor is lca binaryTreeHeight is required for building runs
11 12 13 |
# File 'lib/visitor/numbering_visitor.rb', line 11 def numberNodesInSubtree @numberNodesInSubtree end |
#runBits ⇒ Object
set by third pass with RunBitVisitor, sets bits for each ancestor run
19 20 21 |
# File 'lib/visitor/numbering_visitor.rb', line 19 def runBits @runBits end |
#runHead ⇒ Object
set by second pass traversal with IvVisitor, a run is the path with a single (lowest in tree) node with the greatest binaryTreeHeight. runHead and runTail are the nodes that span the run.
16 17 18 |
# File 'lib/visitor/numbering_visitor.rb', line 16 def runHead @runHead end |
#runTail ⇒ Object
set by second pass traversal with IvVisitor, a run is the path with a single (lowest in tree) node with the greatest binaryTreeHeight. runHead and runTail are the nodes that span the run.
16 17 18 |
# File 'lib/visitor/numbering_visitor.rb', line 16 def runTail @runTail end |