Question

Write pseudocode for a Boolean search function that performs a ternary search for an integer x in an integer array A (sorted in increasing order). The function returns true if x is found in the array and false otherwise. A ternary function generalizes a binary search by splitting the input into three sets of sizes approximately one third of the total. The function header must be:

bool search( A, x, l,