A path in a BST is one traversal from root to a leaf node. Thus if we have a binary tree of the form,

```
   7
 3   9
1 5 8 13

```

The paths would be, 

```
7 3 1 
7 3 5 
7 9 8 
7 9 13 

```

This is my code, which isn't working correctly.

```
public void printPath(Node root){
        Deque<Node> stack = new ArrayDeque<>();
        printPath(root, stack);

    }

    public void printPath(Node root, Deque<Node> stack){

        if(root == null){
            Iterator itr = stack.descendingIterator();
            while(itr.hasNext()){
                Node p = (Node) itr.next();
                System.out.print(p.data + " ");
            }
            stack.poll();
            System.out.println();
            return;
        }
        stack.offerFirst(root);
        printPath(root.left, stack);
        printPath(root.right, stack);

    }

```

This code is not printing all the paths right. Any help appreciated.