Assume that you are given the following linear time algorith…
Assume that you are given the following linear time algorithm: BSTNode *BuildBST(A, n): It takes an array and its size as arguments, builds a binary search tree, and returns a pointer to its root in θ(n) time. A BSTNode structure contains pointers LC, RC of type BSTNode* pointing to the left child and right child of that node respectively. In Step 1 above, you used the above function to write pseudocode to output the array in ascending order in linear time. Step 2: Explain in great detail why the algorithm you wrote is a linear time algorithm.
Read Details