BinaryTree.Node
Node in a binary tree.
This is a subclass of Tree.Node
BinaryTreeNode:__init(key, val)
Constructor
BinaryTreeNode:children()
Returns:
- (
table
) children of this node
BinaryTreeNode:walkInOrder(callback)
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()
Constructor.
BinaryTree:walkInOrder(callback)
Traverses the binary tree starting from the root in order
Arguments:
callback
(function
): function to execute at each node. Optional.