Binary Tree - In Order Sorting - : I have a quick question in a binary tree assignment. I am not sure how to fix the function to sort the binary tree in order and print it. Your feedback is much appreciated.

**Error**

    Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    	The method inOrder(Node) in the type BinaryTree 
         is not applicable for the arguments ()
       	at BinaryTreeTester.main(BinaryTreeTester.java:21)

   

**Method Declaration**

    // This function should sort the tree in order and print it
    public void inOrder(Node current)
    {
    	if (current != null)
    	{
    		inOrder(current.left);
    		System.out.println(current.data);
    		inOrder(current.right);
    	}
    }

 

**Code** 
   
    BinaryTree t1 = new BinaryTree();
    
    // Test insert functions
    t1.insert(100);
    t1.insert(50);
    t1.insert(175);
    t1.insert(200);
    t1.insert(150);
     
    // Test displayInOrder and displayPreOrder
    System.out.println("InOrder: ");
    t1.inOrder(); // this is the line that causes the error

What I understand from this error, is that since the method inOrder(Node)requires a parameter of type Node, the statement "t1.inOrder()" causes an issue since no parameter is used.

I cannot alter the code file and can only workaround the function itself. Any advice on how to fix this?



