What sort of data structure is that? It looks to me like a binary tree. So what is the algorithm for a depth first search? If you are getting the wrong result you are using the wrong algorithm. What do you mean by path? Are you going to have a linked list of nodes to the number sought? Or a
String?
You will have to use the very expensive hardware I so often recommend: a
Cray occupying a building the size of a cinema pencil, eraser, and sheet of paper. ?Write down how you are going to tell whether you have found a value, and how you are going to add it to a path. Since it is recursive, start with a little tree, like this one
Then take your recursion one level higher
and work out how you are to handle something like
Get that sort of thing working, and it becomes easy to scale up for recursion over any kind of tree. You can work out the depth at which you found the value, from the length of the path.