Zippy v0.0.1 Zippy.ZBinTree
This module implements Zipper binary trees, that allow you to traverse them in two directions.
This module is a port of Fred Hebert’s “Zippers” library, under the MIT licence.
Summary
Functions
Adds a left child to the tree
Returns the current element in the binary tree in a tuple
Checks if a node is a leaf, that is to say if it has no child
Goes down the tree, with the current
element being the left
child, or returns nil
if there is no child
Replaces the current element in the tree (if it exists) or create a new node (if it doesn’t)
Goes down the tree, with the current
element being the right
child
Create a new basic binary tree. It should be declared first when declaring the data structure
Goes up the tree, or returns nil
if we’re already at the top of the tree
Types
Functions
Adds a left child to the tree
Returns the current element in the binary tree in a tuple.
Checks if a node is a leaf, that is to say if it has no child.
Goes down the tree, with the current
element being the left
child, or returns nil
if there is no child
Replaces the current element in the tree (if it exists) or create a new node (if it doesn’t).
Goes down the tree, with the current
element being the right
child.
Create a new basic binary tree. It should be declared first when declaring the data structure.
Goes up the tree, or returns nil
if we’re already at the top of the tree.