rebalance method

void rebalance()

Rebalances the tree structure.

Mathematical Operation:

  1. Collects all particles.
  2. Rebuilds tree from scratch with optimal structure.

Implementation

void rebalance() {
  _root.rebalance();
}