private void remove() {
			// Correct the sizeLeft counts
			Node cur = this;
			while (cur.parent != null) {
				if (cur.parent.lChild == cur) {
					cur.parent.sizeLeft--;
				}
				cur = cur.parent;
			}

			// Remove from the tree
			// promote one of my children into my position
			if (parent == null) {
				// prefer the left
				if (lChild != null) {
					root = lChild;
					lChild.parent = null;
				}
				else if (rChild != null) {
					root = rChild;
					rChild.parent = null;
				}
				else {
					root = null;
				}
			}
			else if (parent.lChild == this) {
				if (lChild != null) {
					parent.lChild = lChild;
					lChild.parent = parent;
				}
				else if (rChild != null) {
					parent.lChild = rChild;
					rChild.parent = parent;
				}
				else {
					parent.lChild = null;
				}
			}
			else {
				if (lChild != null) {
					parent.rChild = lChild;
					lChild.parent = parent;
				}
				else if (rChild != null) {
					parent.rChild = rChild;
					rChild.parent = parent;
				}
				else {
					parent.rChild = null;
				}
			}
			if (lChild != null && rChild != null) {
				prev.rChild = rChild;
				rChild.parent = prev;
			}

			// In case the node is re-used, as in update()
			lChild = null;
			rChild = null;
			sizeLeft = 0;
			// The other links are all overwritten by insert

			// Remove from the list
			if (prev == null) {
				head = next;
			}
			else {
				prev.next = next;
			}
			if (next == null) {
				tail = prev;
			}
			else {
				next.prev = prev;
			}
		}
Remove this node from the tree and linked list
Ghidra/Framework/Generic/src/main/java/ghidra/generic/util/datastruct/TreeValueSortedMap.java