Class: Gcntree_node

Gcntree_node(config)

new Gcntree_node(config)

A Gcntree node
Parameters:
Name Type Description
config Object configuration
Properties
Name Type Description
data any the data to associate with this node
parent Gcntree_node node to assign as this node's parent
children Array.<Gcntree_node> nodes to assign as this node's children
Source:

Methods

add_child(node) → {Gcntree_node}

Add a child to this node
Parameters:
Name Type Description
node Gcntree_node node to add as a child
Source:
Returns:
the new child node
Type
Gcntree_node

degree() → {number}

Compute the degree of this node
Source:
Returns:
Type
number

delete_child(node) → {Gcntree_node}

Delete a child from this node
Parameters:
Name Type Description
node Gcntree_node the node to delete
Source:
Returns:
the deleted node
Type
Gcntree_node

get_all_children() → {Array.<Gcntree_node>}

Fetch all of this node's children
Source:
Returns:
Type
Array.<Gcntree_node>