Answer:
Explanation:
The objective of the question (a) is to place the given numbers 10, 16, 1, 4, 5, 17, 12, 21, 2, 6, 8 in the order in which they appear in a binary search tree.
So; from the attached file below ; we will see a diagram representation the above computation in a binary tree diagram.
However, during the process of constructing the binary search tree ; when i place 17 and 6; the number that i compare with are explained as follows:
Let take them one after the other;
SO for 17; we need to compare 17 with 10 first; then move towards the right to compare it with 16.
So ; the answer is 10,16 in that order.
For 6 ;
We first compare it with 10; go to the left and compare it with 1; then we follow the right path and again compare it with 4; then to the right again by comparing it with 5
So; the answer is 10,1,4,5 in that order.