Question: Write C++ code, algorithm and plot graphs Design a recursive algorithm to perform ternary search Ternary-Search(A, key,lb,ub) on a list of numbers A in non-decreasing

Write C++ code, algorithm and plot graphs
Design a recursive algorithm to perform ternary search Ternary-Search(A, key,lb,ub) on a list of numbers A in non-decreasing order. Consider the same conditions as considered for binary search. Construct the recurrence relation for the algorithm. Solve it to find the time complexity. Compare time-space required by recursive and iterative versions of ternary search. Find the speed up achieved by ternary search over binary search. Compare the space required by binary and ternary search. Plot graphs to compare time and space by varying input size as n = 10, 100, 1000, 10000, 100000, 1000000. a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
