public void clear() { if (root != null) { root.purge(height); root = null; } height = 0; n = 0; updateCounter += 1; modify(); }