Remove the node containing the given key and element. The node MUST exists, else the tree won't be valid anymore.
778761
@Override
    public void remove(long key, T element) {
    	if (first.value == key && ObjectUtil.equalsOrNull(element, first.element)) {
    		removeMin();
    		return;
    	}
    	if (last.value == key && ObjectUtil.equalsOrNull(element, last.element)) {
    		removeMax();
    		return;
    	}
    	
    	// if both children of root are black, set root to red
    	if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
            root.red = true;

        root = remove(root, key, element);
        if (root != null) root.red = false;
    }
222615
public synchronized boolean remove(final K key) {
		if (readOnly) {
			return false;
		}
		if (!validState) {
			throw new InvalidStateException();
		}
		if (key == null) {
			return false;
		}
		try {
			if (log.isDebugEnabled()) {
				log.debug("trying remove key=" + key);
			}
			submitRedoRemove(key);
			if (removeIterative(key)) { // removeRecursive(key, rootIdx)
				elements--;
				Node<K, V> nodeRoot = getNode(rootIdx);
				if (nodeRoot.isEmpty() && (elements > 0)) { // root has only one child
					// Si sale un ClassCastException es porque hay algun error en la cuenta de elementos
					rootIdx = ((InternalNode<K, V>) nodeRoot).childs[0];
					// Clean old nodeRoot
					freeNode(nodeRoot);
					if (log.isDebugEnabled()) {
						log.debug("DECREASES TREE HEIGHT (ROOT): elements=" + elements + " oldRoot="
								+ nodeRoot.id + " newRoot=" + rootIdx);
					}
					height--; // tree height
				} else if (nodeRoot.isEmpty() && nodeRoot.isLeaf() && (elements == 0)
						&& (getHighestNodeId() > 4096)) {
					// Hace un reset del arbol para liberar espacio de modo rapido
					if (log.isDebugEnabled()) {
						log.debug("RESET TREE: elements=" + elements + " leaf=" + nodeRoot.isLeaf()
								+ " empty=" + nodeRoot.isEmpty() + " id=" + nodeRoot.id + " lastNodeId="
								+ getHighestNodeId() + " nodeRoot=" + nodeRoot);
					}
					clear();
				} else if ((elements == 0) && (!nodeRoot.isLeaf() || !nodeRoot.isEmpty())) {
					log.error("ERROR in TREE: elements=" + elements + " rootLeaf=" + nodeRoot.isLeaf()
							+ " rootEmpty=" + nodeRoot.isEmpty() + " rootId=" + nodeRoot.id + " nodeRoot="
							+ nodeRoot);
				}
				return true;
			}
			return false;
		} finally {
			stackNodes.clear();
			stackSlots.clear();
			releaseNodes();
		}
	}
1242659
protected DoubleLinkedElement<T> removeElem(final T key) {
    DoubleLinkedElement<T> found = (DoubleLinkedElement<T>) (super
        .removeElem(key));
    if (found == null) {
      return null;
    }

    // update linked list
    if (found.after != null) {
      found.after.before = found.before;
    }
    if (found.before != null) {
      found.before.after = found.after;
    }
    if (head == found) {
      head = head.after;
    }
    if (tail == found) {
      tail = tail.before;
    }
    return found;
  }
577807
protected boolean removeIterative(final K key) {
		final LeafNode<K, V> nodeLeaf = findLeafNode(key, true);
		//
		// Find in leaf node for key and delete it
		final int slot = nodeLeaf.findSlotByKey(key);
		if (slot >= 0) { // found
			// Remove Key
			nodeLeaf.remove(slot);
			putNode(nodeLeaf);
			// Iterate back over nodes checking underflow
			while (!stackNodes.isEmpty()) {
				final InternalNode<K, V> node = stackNodes.pop();
				final int slotcheck = stackSlots.pop();
				if (!node.checkUnderflow(slotcheck)) {
					return true;
				}
			}
			return true;
		}
		return false;
	}
973160
def remove_child(node)
      unless (index = search_node_index(node))
        PEROBS.log.fatal "Cannot remove child #{node._id} from node #{@_id}"
      end

      if index == 0
        # Removing the first child is a bit more complicated as the
        # corresponding branch key is in a parent node.
        key = @keys.shift
        update_branch_key(key)
      else
        # For all other children we can just remove the corresponding key.
        @keys.delete_at(index - 1)
      end

      # Remove the child node link.
      child = @children.delete_at(index)
      # If we remove the first or last leaf node we must update the reference
      # in the BigTree object.
      @tree.first_leaf = child.next_sibling if child == @tree.first_leaf
      @tree.last_leaf = child.prev_sibling if child == @tree.last_leaf
      # Unlink the neighbouring siblings from the child
      child.prev_sibling.next_sibling = child.next_sibling if child.prev_sibling
      child.next_sibling.prev_sibling = child.prev_sibling if child.next_sibling

      if @keys.length < min_keys
        # The node has become too small. Try borrowing a node from an adjecent
        # sibling or merge with an adjecent node.
        if @prev_sibling && @prev_sibling.parent == @parent
          borrow_from_previous_sibling(@prev_sibling) ||
            @prev_sibling.merge_with_branch_node(myself)
        elsif @next_sibling && @next_sibling.parent == @parent
          borrow_from_next_sibling(@next_sibling) ||
            merge_with_branch_node(@next_sibling)
        end
      end

      if @parent.nil? && @children.length <= 1
        # If the node just below the root only has one child it will become
        # the new root node.
        new_root = @children.first
        new_root.parent = nil
        @tree.root = new_root
      end
    end
1228774
public void remove(String key) {
        Map<String, String> map = inheritableThreadLocal.get();
        if (map != null) {
            map.remove(key);
        }
    }
1192354
def delete(self, key):
    '''
    '''
    super(DirectoryTreeDatastore, self).delete(key)

    str_key = str(key)

    # ignore root
    if str_key == '/':
      return

    # retrieve directory, to remove entry
    dir_key = key.parent.instance('directory')
    directory = self.directory(dir_key)

    # ensure key is not in directory
    if directory and str_key in directory:
      directory.remove(str_key)
      if len(directory) > 0:
        super(DirectoryTreeDatastore, self).put(dir_key, directory)
      else:
        super(DirectoryTreeDatastore, self).delete(dir_key)
538434
def remove(self, key):
        

        data = self._load_file()
        del data[key]
        self._save_file(data)
942444
private UpdateResult delete(long key, Node node) {
        UpdateResult result;
        if (node == null) {
            // Item not found.
            result = new UpdateResult();
        } else {
            long itemKey = node.item.key();
            if (key < itemKey) {
                // Given key is smaller than the current node's item key; proceed to the node's left child.
                result = delete(key, node.left);
                node.left = result.node;
            } else if (key > itemKey) {
                // Given key is larger than the current node's item key; proceed to the node's right child.
                result = delete(key, node.right);
                node.right = result.node;
            } else {
                // Found the node. Remember it's item.
                result = new UpdateResult();
                result.updatedItem = node.item;
                if (node.left != null && node.right != null) {
                    // The node has two children. Replace the node's item with its in-order successor, and then remove
                    // that successor's node.
                    node.item = findSmallest(node.right);
                    node.right = delete(node.item.key(), node.right).node;
                } else {
                    // The node has just one child. Replace it with that child.
                    node = (node.left != null) ? node.left : node.right;
                    this.size--;
                    this.modCount++;
                }
            }

            // Rebalance the sub-tree, if necessary.
            result.node = balance(node);
        }

        return result;
    }
896068
def remove_key(self, key):
        """"""
        try:
            self._own_keys.discard(key)
            if self._parent and self._parent.has_key(key):
                self._container[key] = self._parent[key]
            else:
                del self._container[key]
        except KeyError:
            pass
366404
def delete(self, key):
        
        validate_is_bytes(key)

        self.root_hash = self._set(self.root_hash, encode_to_bin(key), b'')
541213
public V remove(Object key) {
        List<V> res = map.remove(key);
        if (res == null) {
            return null;
        }
        assert (!res.isEmpty());
        return res.iterator().next();
    }
796111
def delete_node(self, node: str):
        
        if self.has_node(node):
            self.remove_node(node)
318124
def delete_node(self, name):
        

        name = self._validate_name(name)
        if name in self.nodes:
            del self.nodes[name]
518239
def remove(self, key):
        """"""
        item = self.item_finder.pop(key)
        item[-1] = None
        self.removed_count += 1
1177185
def remove_item(self, key):
        
        self._db.remove(self._urls.key==key)
1264470
public void removeKey(String key) {
        if (key != null && !key.isEmpty()) {
            for (int i=0; i<map.size(); i++) {
                KeyValue kv = map.get(i);
                if (key.equals(kv.getKey())) {
                    map.remove(i);
                    return;
                }
            }
        }
    }