Question: (ii) (5 points) Say that T is fully sorted if each row in T is sorted (in increasing order from left to right), and the

(ii) (5 points) Say that T is fully sorted if each row in T is sorted (in increasing order from left to right), and the last entry in each row, except the last row, is smaller than the first entry in the next row; that is, Tli, nT[i+1, 1), for i = 1,...,n - 1. See Figure 2 for illustration. 5 10 12 20 25 26 27 30 33 36 41 43 47 50 55 60 62 75 80 84 87 90 92 96 99 Figure 2: An illustration of a 5 x 5 fully sorted table. What is the most efficient way (i.e., the best running time) we know for deciding whether a number key is in a fully sorted nxn table T? You do not need to provide the full pseudocode of the algorithm; it is enough to describe how the algorithm works, and to analyse/justify its running time. (ii) (5 points) Say that T is fully sorted if each row in T is sorted (in increasing order from left to right), and the last entry in each row, except the last row, is smaller than the first entry in the next row; that is, Tli, nT[i+1, 1), for i = 1,...,n - 1. See Figure 2 for illustration. 5 10 12 20 25 26 27 30 33 36 41 43 47 50 55 60 62 75 80 84 87 90 92 96 99 Figure 2: An illustration of a 5 x 5 fully sorted table. What is the most efficient way (i.e., the best running time) we know for deciding whether a number key is in a fully sorted nxn table T? You do not need to provide the full pseudocode of the algorithm; it is enough to describe how the algorithm works, and to analyse/justify its running time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
