boolean isParent(TreeNode x, Set<TreeNode> set) {
        Queue<TreeNode> q = new LinkedList<>();
        q.add(x);
        while (!q.isEmpty()) {
            TreeNode current = q.remove();
            set.remove(current);
            if (current.left != null)
                q.add(current.left);
            if (current.right != null)
                q.add(current.right);

        }
        return set.isEmpty();
    }
Why Did you create this class? what does it do?
src/problems/medium/SmallestSubtreewithalltheDeepestNodes.java