Question: Problem 3 (20 points) Complete the code of a recursive linear-time function isSearchTree below that takes a pointer to the root of a binary tree

Problem 3 (20 points) Complete the code of a recursive linear-time function isSearchTree below that takes a pointer to the root of a binary tree and tests whether this binary tree satisfies the search tree property at every node: I test whether a given binary tree is a binary search tree and return true if it is, otherwise false bool isSearchTree(Node* node) \ 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 l 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
Get step-by-step solutions from verified subject matter experts
