Question: Problem 3 (30 points) Complete the code of a recursive function findPath below that takes a pointer to the root of a binary tree and

 Problem 3 (30 points) Complete the code of a recursive function

Problem 3 (30 points) Complete the code of a recursive function findPath below that takes a pointer to the root of a binary tree and returns a vector of keys on a path (any path) from the root to the node with a given key value. This function has the following arguments: root is a pointer to the root of a tree path is a reference to a vector of keys of nodes along the path target is the key of the node to which a path needs to be found // find a path from root node to a given node and store the found path in a vector path // return true if a path exists otherwise false bool findPath(Node *root, std:vector int> &path, int target) \

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!