Tree

Tree

new Tree(value)

Class Representing a Basic Tree

Author:
  • Himanshu Jangid
Source:
Parameters:
Name Type Description
value string

Methods

insertChild(value) → {Tree}

Source:
Parameters:
Name Type Description
value number value for the new node to add
Returns:
Type:
Tree
the new tree formed by insertion

traverse(tree)

Takes a tree as a parameter and traverses all trough that tree from top to bottom

Source:
Parameters:
Name Type Description
tree Tree