Tree Class

Module: BinaryUtils

Tree structure used to represent Trees.

Every tree stores Trees as children and have a parent children.

If the parent is null then the Tree is the root.

Item Index

Methods

Methods

add

(
  • tree
)

Add new element to tree.

Parameters:

  • tree Object

    Object to be added to the three, if object is not a tree a new tree is created automatically.

clone

() Tree

Clone tree recursively.

The cloned tree has the same UUID.

Returns:

Tree:

Cloned tree.

print

(
  • level
)

Print tree into console, recursively.

Parameters:

  • level Number

    Recursive parameter, not required.

remove

(
  • tree
)

Remove element from tree.

Parameters:

  • tree Tree

    Element to be removed from the three