/** * Remove the specified element from the tree outright. */ public void remove(Element<T0> element) { SimpleNode < T0> node = ( SimpleNode < T0> )element; assert(root != null); // delete the node by adding to the zero queue fixCountsThruRoot(node, -1 ); zeroQueue.add(node); drainZeroQueue(); assert(valid()); }
/** * Remove the specified element from the tree outright. */ public void remove(Element<T0> element) { SimpleNode < T0> node = ( SimpleNode < T0> )element; assert(root != null); // delete the node by adding to the zero queue fixCountsThruRoot(node, -1 ); zeroQueue.add(node); drainZeroQueue(); assert(valid()); }
/** * Remove the specified element from the tree outright. */ public void remove(Element<T0> element) { SimpleNode < T0> node = ( SimpleNode < T0> )element; assert(root != null); // delete the node by adding to the zero queue fixCountsThruRoot(node, -1 ); zeroQueue.add(node); drainZeroQueue(); assert(valid()); }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }
/** * Remove size values at the specified index. Only values of the type * specified in indexColors will be removed. * * <p>Note that if the two nodes on either side of the removed node could * be merged, they probably will not be merged by this implementation. This * is to simplify the implementation, but it means that when iterating a * tree, sometimes multiple nodes of the same color and value will be * encountered in sequence. */ public void remove(int index, int size) { if(size == 0) return; assert(index >= 0); assert(index + size <= size( )); assert(root != null); // remove values from the tree removeFromSubtree(root, index, size); // clean up any nodes that got deleted drainZeroQueue(); assert(valid()); }