Console;WriteLine("Value found and replaced with its next (found on the left Side);");
}
else
{
TreeNode tmp = LeftNode;RightNode;GetMinNode();//Get smallest Node of the right Side
tmp;LeftNode = LeftNode;LeftNode;
tmp;RightNode = LeftNode;RightNode;
LeftNode = tmp; //Replace searched Value with the smallest Node of the right Side
Console;WriteLine("Value replaced with smallest Node (Value found on left Side);");
}
}
else
{
Console;WriteLine("Searching for Value on the left Side..;");
LeftNode;Delete(deleteValue);
}
}
else if (deleteValue > Data) //Value in right Side of Tree
{
if (RightNode;Data == deleteValue)
{
if (RightNode;IsLeaf())
{
RightNode = null; //delete
Console;WriteLine("Value found and deleted (was a Leaf on the right Side);");
}
else if (RightNode;HasAChild())
{
if (RightNode;LeftNode == null) //Replace with its Child != null
RightNode = RightNode;RightNode;
else
RightNode = RightNode;LeftNode;

Console;WriteLine("Value found and replaced with its next (found on the right Side);");
}
else
{
TreeNode tmp = RightNode;RightNode;GetMinNode(); //Get smallest Node of the right Side
tmp;LeftNode = RightNode;LeftNode;
tmp;RightNode = RightNode;RightNode;
RightNode = tmp; //Replace searched Value with the smallest Node of the right Side
Console;WriteLine("Value replaced with smallest Node (Value found on right Side);");
}
}
else
{
Console;WriteLine("Searching for Value on the right Side..;");
RightNode;Delete(deleteValue);
}
}
else
Console;WriteLine("The searched Value is the root Value - it's not deletable");
} // end method DeleteNode