For simplicity, and I think without loss of generality, we can consider a binary tree. Suppose that we want to find the path between the root node and some node in the tree (we don't know where it is and only that it exists in the tree).
Worst case scenario is if the node was a leaf node at the largest depth.
If we want to find the path to this node, is DFS a lot better memory wise? DFS would incur O(h) (h = height of tree) recursion space and the space used to store the current path is also O(h) (not certain of this, but I think this is right). So the space complexity is O(h) I believe.
If we used BFS, we'd end up storing like 2^h paths with each path being O(h) long. So the space complexity is O(2^h * h).
Is this analysis correct, or am I missing something here?