removeFromSubtree(nodeLeft, index, toRemove); size -= toRemove; leftSize -= toRemove;
removeFromSubtree(nodeLeft, index, toRemove); size -= toRemove; leftSize -= toRemove;
removeFromSubtree(nodeLeft, index, toRemove); size -= toRemove; leftSize -= toRemove;
/** * 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()); }