public List<T> DFS() {
        List<T> dfsTraversalElements = new ArrayList<T>();
        Stack<BinaryTree<T>> nodes = new Stack<BinaryTree<T>>();
        nodes.push(this);
        while (!nodes.isEmpty()) {
            BinaryTree<T> node = nodes.pop();
            if(node != null) {
                nodes.push(node);
                BinaryTree<T> leftNode = node.left;
                while (leftNode != null) {
                    nodes.push(leftNode);
                    leftNode = leftNode.left;
                }
                BinaryTree<T> leftMostNode = nodes.pop();
                if(leftMostNode != node.left || leftMostNode.right == null) {
                    dfsTraversalElements.add(leftMostNode.value);
                }
                BinaryTree<T> rightNode = node.right;
                while (rightNode != null) {
                    nodes.push(rightNode);
                    rightNode = rightNode.right;
                }
                BinaryTree<T> rightMostNode = nodes.pop();
                if(rightMostNode != node.right || rightMostNode.left == null) {
                    dfsTraversalElements.add(rightMostNode.value);
                }
            }
        }
        dfsTraversalElements.add(nodes.pop().value);

        return dfsTraversalElements;
    }