BinaryTree.Node

Node in a binary tree. This is a subclass of Tree.Node

BinaryTreeNode:__init(key, val)

View source

Constructor

BinaryTreeNode:children()

View source

Returns:

  • (table) children of this node

BinaryTreeNode:walkInOrder(callback)

View source

Traverses the tree in order.

Arguments:

  • callback (function): function to execute at each node. Optional.

BinaryTree

Implementation of binary tree. This is a subclass of Tree.

BinaryTree:__init()

View source

Constructor.

BinaryTree:walkInOrder(callback)

View source

Traverses the binary tree starting from the root in order

Arguments:

  • callback (function): function to execute at each node. Optional.