Question: Please answer them in C++. Write a program which takes in a complete proper binary tree . Your program will check if the inputted tree
Please answer them in C++. Write a program which takes in acomplete proper binary tree. Your program will check if the inputted tree is abinary search tree. If it is your program must output TRUE or FALSE otherwise.
Just as in the lab on trees, the tree will be inputted into the computer layer-by-layer starting at the root. Input it terminated with -1.
Input:
1
2
3
4
5
6
-1
Output: FALSE
Input:
9
5
15
1
8
12
-1
Output: TRUE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
