Binary Tree
A downloadable game for Windows, macOS, Linux, and Android
/**
* BinaryTree is a simple binary search tree that stores unique int values.
*
* For every node, all values in its left subtree are smaller and all values
* in its right subtree are larger. Duplicate values are ignored.
*
* The tree supports:
* - insert(int): adds a value (the first value becomes the root)
* - contains(int): checks whether a value is stored in the tree
* - inorder(): prints all values in ascending order
*
* Internally, the tree consists of BinaryNode objects (a private static
* inner class). Each node holds one value and references to its left and
* right child. The tree class itself only keeps a reference to the root and
* delegates the work to the nodes, which solve it recursively.
*/
Download
Click download now to get access to the following files:

Leave a comment
Log in with itch.io to leave a comment.