Question: Problem 3: (5 pts) The ternary search algorithm is a modification of the binary search algorithm that splits the input not into two sets of
Problem 3: (5 pts) The ternary search algorithm is a modification of the binary search algorithm that splits the input not into two sets of almost-equal sizes, but into three sets of sizes approximately one- third a) Write pseudo-code a recursive ternary search algorithm b) Let T(n) denote the running time of ternary on an array of size n. Write a recurrence relation for T(n). c) Solve the recurrence relation to obtain the asymptotic running time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
