DataNode

DataNode

Tree node with data property.

Constructor

new DataNode(data)

Create a data node with given data.

Source:
Parameters:
Name Type Description
data *

Members

children :array

Array of children nodes.

Source:
Type:
  • array

data :*

Data property.

Source:
Type:
  • *

size :number

Number of nodes.

Source:
Type:
  • number

Methods

append(node)

Append the given node to the end of the children list.

Source:
Parameters:
Name Type Description
node DataNode

insert(i, node)

Insert the given node at specified index in the children list.

Source:
Parameters:
Name Type Description
i number
node DataNode

remove(node) → {DataNode}

Remove the given node from the branch.

Source:
Parameters:
Name Type Description
node DataNode
Returns:
Type:
DataNode

removeAtIndex(i) → {DataNode}

Remove the node at the given index from the branch.

Source:
Parameters:
Name Type Description
i number
Returns:
Type:
DataNode