In my 'Program.cs' I am trying to call method 'inOrder()' from another class 'BinTree.cs'.
Class BinTree starts with class BinTree<T> where T : IComparable
I've tried:
inOrder();
and
BinTree<T>.inOrder();
and
BinTree<int>.inOrder();
But none of these work.
Thanks for looking.
EDIT:
class Program
{
static void Main(string[] args)
{
Node<int> tree = new Node<int>(6);
tree.Left = new Node<int>(2);
tree.Left.Right = new Node<int>(5);
tree.Left.Right.Data = 3;
tree.Right = new Node<int>(8);
(new BinTree<int>()).inOrder();
}
EDIT2:
private Node<T> root;
public BinTree() //creates an empty tree
{
root = null;
}
public BinTree(Node<T> node) //creates a tree with node as the root
{
root = node;
}