// 6. Decrease a key value public void decreaseKeyVariable(int old_value, int new_value) { BinomialHeapNode temp = Nodes.findANodeWithKey(old_value); if (temp == null) return; temp.key = new_value; BinomialHeapNode tempParent = temp.parent; while ((tempParent != null) && (temp.key < tempParent.key)) { int z = temp.key; gen(21, temp, tempParent); temp.key = tempParent.key; tempParent.key = z; temp = tempParent; tempParent = tempParent.parent; } }
// 7. Delete a node with a certain key public void delete(int value) { if ((Nodes != null) && (Nodes.findANodeWithKey(value) != null)) { decreaseKeyVariable(value, findMinimum() - 1); extractMin(); } }