Binary-Trees

๐ŸŒณ A Game About Binary Trees

A small experimental game designed to gamify the learning process of binary trees.

๐ŸŽฎ Current Features

This is a very early version โ€” just the bare bones for now:

  1. Radial Binary Search Tree Generation
    • Each node can have up to two children, positioned radially outward from their parent.
    • Edges are color-coded:
      • ๐Ÿ”ด Red for smaller values (left child)
      • ๐Ÿ”ต Blue for larger values (right child)
    • This color scheme reflects how binary search works.
  2. Tree Rotations
    • Pressing the nodes, you can perform standard tree rotations (node always moves inwards) to balance the tree, just like in AVL trees.
  3. The Goal (for now)
    • Make the tree well-balanced, using as few rotations and as little time as possible.
    • A node is called balanced if its left and right subtreeโ€™s height differ by at most 1.
    • A tree is considered well-balanced if all of its nodes are balanced.
    • Unbalanced nodes are marked in red.

๐Ÿ“ธ Screenshot

balanced tree

๐Ÿ”— Play the Game

๐Ÿ’ฌ Feedback

Got ideas or suggestions? Iโ€™d love to hear them! This is a small side project โ€” feedback, bugs, or feature requests are welcome.

๐Ÿ“‡ Contact