Skip to content

TotallyReal/Binary-Trees

Repository files navigation

🌳 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.

  • Right now, it doesn't recieve touch input, so it can only played with a mouse.

📇 Contact

About

Binary Trees

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published