Question: 3. The recursive definition for a binary tree from page 4 of worksheet 1 is: Basis: A single vertex is a binary tree. Recursive


3. The recursive definition for a binary tree from page 4 of worksheet 1 is: Basis: A single vertex is a binary tree. Recursive rule: If T and T are binary trees, then joining a new top vertex to the top of T at the left and T at the right is a binary tree. T NJ Show how to build the binary tree shown step by step, starting with a single vertex. Clearly label each binary tree built along the way, and identify what previous trees T and T are used each step. Pseudocode: A Recursive Binary Search Algorithm. 1 procedure binary search (i, j, x: integers, 1ijn) 2 m:= [(i+j)/2] 3 if x=am then 4 5 else 6 7 else else return 0 8 return m if (x am and j> m) then return binary search (m + 1. j. x) 9 10 (output is location of x in a1,a2....an if it appears; otherwise it is 0} C Use the pseudocode to write a C++ program that implements and tests the recursive binary search algorithm.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
