Data Structure Β· Tower Defense Β· Rogue-lite

Red-Black Tree Defense

Nodes N0
Depth H0
Opt ⌊logβ‚‚NβŒ‹+10
Bound 2logβ‚‚(N+1)0
Query latency0 ms
Call stack
0 / 12
Memory (HP)
128 / 128 MB
Wave0
Score0

Red-Black Tree Defense

Your server's index is a binary search tree. Data packets are flooding in. Each one slides down the tree (smaller ← β†’ larger) and docks as a red leaf.

  • Click a node, then Left Rotate, Right Rotate or Recolor it.
  • The moment the whole tree is a valid red-black tree, GC wipes out every docked packet.
  • Let it lean: latency spikes eat your memory. Too deep: Stack Overflow.

click node Β· Q ⟲ Β· W ◐ Β· E ⟳ Β· arrows move