Question: A = [ KHYRO , REIVA , FLINN , DARIA , FLINT , MYIAH , MILENA , DARIN , MILES , KHYRA ] B =
A = [ KHYRO , REIVA , FLINN , DARIA , FLINT , MYIAH , MILENA , DARIN , MILES , KHYRA ]
B = [ A [ U[ i ]] for i in range (10) ]
U = [4,2,0,5,1,8,3,6,7,9]
a) Draw the binary search tree we obtain if we start from the empty tree and add consecutively the elements of the array B calculated above, i.e. starting from B[0] and going to B[9]. Explain step-by-step how the last element (B[9]) is inserted in the tree.
(b) Enumerate the elements of the tree you constructed in part (a) using (left-first) depth-first search (and pre-order).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
