Question: Questions 1 and 2 are concerned with the RecursionMystery algorithm below. Input: data: sorted array with n elements Input: n: size of data Input: bst:

Questions 1 and 2 are concerned with the RecursionMystery algorithm below.

Input: data: sorted array with n elements

Input: n: size of data

Input: bst: a binary search tree

1 Algorithm: RecursionMystery

2 if n = 1 then

3 bst.Insert(data[1])

4 else if n > 1 then

5 mid = dn/2e

6 bst.Insert(data[mid])

7 RecursionMystery(data[1..mid 1], bst)

8 RecursionMystery(data[mid + 1..n], bst)

9 end

1) What are the bst insertions that would occur when invoking RecursionMystery on the array [13, 19, 33, 40, 40, 63, 92]? Be sure to list your answer in the order in which RecursionMystery would insert the values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!