public void Search(int key) { if (_root == null) { Console.WriteLine("Tree is empty!"); return; } BinaryTreeNode targetNode = _root.Search(key); if (targetNode == null) { Console.WriteLine("Search failed"); return; } Console.WriteLine("Value found: " + targetNode.GetValue()); }
private void CopyFrom(BinaryTreeNode node) { SetKey(node.GetKey()); SetValue(node.GetValue()); }