Module: NodeExtensions

Included in:
Node
Defined in:
lib/visitor/numbering_visitor.rb

Overview

monkey patching dfsNumber and numberNodesInSubtree

Instance Attribute Summary collapse

Instance Attribute Details

#binaryTreeHeightObject

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

#dfsNumberObject

set by first pass traversal with NumberingVisitor



7
8
9
# File 'lib/visitor/numbering_visitor.rb', line 7

def dfsNumber
  @dfsNumber
end

#numberNodesInSubtreeObject

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

#runBitsObject

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

#runHeadObject

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

#runTailObject

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