trees :: RBTreeNode
trees :: RBTreeNode :: defaultinit
trees $ RBTreeNode :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
trees :: BinTreeNode :: defaultinit
trees :: RBTreeNode :: defaultinit
core :: Comparable :: defaultinit
trees :: TreeNode :: defaultinit
core :: Object :: defaultinit
trees :: BinTreeNode :: grandparent
parent
of the parent
of this node (null if root)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
trees :: BinTreeNode :: left
left
tree node child (null if node has no left child)
trees :: BinTreeNode :: left=
setleft
child for this node (or null if left no child)
core :: Object :: output_class_name
Display class name on stdout (debug only).trees :: BinTreeNode :: right
right
tree node child (null if node has no right child)
trees :: BinTreeNode :: right=
setright
child for this node (or null if right no child)
Tree
implementation
# RedBlackTree node (can be red or black)
class RBTreeNode[K: Comparable, E]
super BinTreeNode[K, E]
redef type N: RBTreeNode[K, E]
# Is the node red?
private var is_red = true
redef fun to_dot do
if is_red then
return "\"{self}\"[style=filled,fillcolor=red,fontcolor=white];\n"
else
return "\"{self}\"[style=filled,fillcolor=black,fontcolor=white];\n"
end
end
end
lib/trees/rbtree.nit:129,1--146,3