Describe the worst-case time complexity, measured in terms of comparisons, of the ternary search algorithm described in Exercise 27 of Section 3.1.

Solution: Step1:In this problem we have to analyze the worst-case time complexity of the ternary search algorithms.In ternary search algorithm we first divide the list of given ordered number into three parts.The division is done by [1,n/3],[n/3+1,2n/3],2n/3+1,n]Step 2 :Next we find in which, the desired number must lie.So that compare the desired number with the last element of the first part. * If the desired number is small..’. Our search arrow down to the first part, whose size is of the given list.* If the desired number is greater than the last element of the second part.If desired number is smaller,than we search the second part or else the third part..’. At most two comparisons to shorten the search result by 1/3rd.