| Class | Tree::BinaryTreeNode |
| In: |
lib/tree/binarytree.rb
|
| Parent: | TreeNode |
Provides a Binary tree implementation. This tree node allows only two child nodes (left and right childs). It also provides direct access to the left and right children, including assignment to the same.
Adds the specified child node to the receiver node. The child node‘s parent is set to be the receiver. The child nodes are added in the order of addition, i.e., the first child added becomes the left node, and the second child will be the second node. If only one child is present, then this will be the left child.
Returns true if this is the left child of its parent. Always returns false if this is the root node.
Returns true if this is the right child of its parent. Always returns false if this is the root node.