### Home Classes Methods

### In Files

- lib/data-structures.rb

### Parent

Object

### Methods

- ::new
- #clone
- #hash

### Files

- LessThan5BlueLabels.txt
- AtLeast2LargeSegments.txt

### Class Index

Quicksearch

- AddLabelTool
- AllRulesAppliedGoal
- Area
- AreaConstraint
- Array
- BalancedBinaryTree
- BalancedBinaryTreeNode
- CloseObserver
- Constants
- Constraint
- CurrentLabelledShape
- DistinctShapeConstraint
- Execution
- Goal
- Grammar
- Label
- LabelledShape
- LineDescriptor
- LinearLinkedList
- LinearLinkedListNode
- NoLabelsGoal
- NoMoreRulesGoal
- NoScalesConstraint
- Numeric
- Object
- OrderedPoint
- PiList
- Point
- Project
- Robot
- Rule
- RuleGroupsObserver
- RuleLabelledShape
- RuleShapeObserver
- Segment
- ShaDeLayersObserver
- Shade
- ShadeUtils
- UndoObserver

No matching classes.

# BalancedBinaryTreeNode

Author | Manuela Ruiz (mruiz@lcc.uma.es)

This class represents a node of a BalancedBinaryTree

### Attributes

height[RW]

The height of the node in the tree

left[RW]

Left offspring TreeNode

right[RW]

Right offspring TreeNode

key[RW]

LineDescriptor or Label

list[RW]

First node of the colinear line list or the point with same label list

### Public Class Methods

new(height, left, right, key, list) click to toggle source

height::The height of the node in the tree left::Left offspring TreeNode right::Right offspring TreeNode key::#LineDescriptor or Label list::#First node of the colinear line list or the point with same label list

Initialize the node

         # File lib/data-structures.rb, line 413
    413:         def initialize(height, left, right, key, list)

    414:                 @height, @left, @right, @key, @list = height, left, right, key, list

    415:         end

### Public Instance Methods

clone() click to toggle source

returns::a new BalancedBinaryTreeNode, identical to this one, except for the fields right and left which are nil in the cloned one, and the height, which is 0

         # File lib/data-structures.rb, line 419
    419:         def clone()

    420:                 return BalancedBinaryTreeNode.new(0, nil, nil, @key.clone, @list.clone)

    421:         end

hash() click to toggle source

returns | the hash code for this list

         # File lib/data-structures.rb, line 424
    424:         def hash

    425:                 return [@height.hash, @key.hash, @list.hash]

    426:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.