public void remove(int node) { tree.remove(node); }
/** * Update <code>node</code> with the current data. */ public void update(int node) { final int prev = prev(node); final int next = next(node); if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) { // Update can be done in-place copy(node); for (int n = node; n != NIL; n = parent(n)) { fixAggregates(n); } } else { // TODO: it should be possible to find the new node position without // starting from scratch remove(node); add(); } }
/** * Update <code>node</code> with the current data. */ public void update(int node) { final int prev = prev(node); final int next = next(node); if ((prev == NIL || compare(prev) > 0) && (next == NIL || compare(next) < 0)) { // Update can be done in-place copy(node); for (int n = node; n != NIL; n = parent(n)) { fixAggregates(n); } } else { // TODO: it should be possible to find the new node position without // starting from scratch remove(node); add(); } }