recursion and binary trees. how do i write the commented parts : 	how do i write the code to find a certain node. specifically how do i say a node was visited after i check it 

public Iterator<T> pathToRoot(T targetElement, BinaryTreeNode<T> current)
			throws ElementNotFoundException
		{
			Stack<BinaryTreeNode<T>> myStack = new Stack<>();
			if (current == null)
				return null;
			
			if (current.element.equals(targetElement)) //found it
			{
				myStack.push(current); //adds the current element to the stack 
			}
				// mark as visited
				//mark node also as found
				// return the found element
				
			if (current.hasLeftChild() || current.hasRightChild()) //if the current node has a left or right child
			{
				// mark node as visited
			}
			if (current.hasLeftChild())//if the current node has a left child node
				pathToRoot(targetElement, current.getLeft()); // check the left child node
			
			if (current.hasRightChild())//same thing as above but for the right
				pathToRoot(targetElement, current.getRight());
			
			if(current != targetElement && /*node has been visited*/)
				myStack.pop(); // pop node from the stack
			
			return myStack.toString(); //return string of path to root
		}
/*using a dfs search to find a node*/