I have created a BinaryTreeNode<T>
class and then creating Add(T data)
method for BinaryTree<T>
class.
When I try to compare Values of objects compiler says :
operator '<' cannot be applied to operands of type 'T' and 'T'.
Example:
public void AddNode(T data) {
BinaryTreeNode<T> node = new BinaryTreeNode<T>(data);
BinaryTreeNode<T> temp = root;
if (temp.Value < node.Value) // **PROBLEM HERE**
...
I'm C# noob and using VS08 Express Edition. Please help.