Consider an array $A$ of integers of size $n$. The indices of $A$ run from 1 to $n$. An algorithm is to be designed to check whether $A$ satisfies the condition given below.
$\forall i, j \in\{1, \ldots, n-1\}$ such that $i>j,(A[i+1]-A[i])>(A[j+1]-A[j])$
Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
An array $A$ of length $n$ with distinct elements is said to be bitonic if there is an index $1=i=n$ such that $A[1 . . i]$ is sorted in the non-decreasing order and $A[i+1 . . n]$ is sorted in the non-increasing order.
Which ONE of the following represents the best possible asymptotic bound for the worstcase number of comparisons by an algorithm that searches for an element in a bitonic array $A$?
GATE CSE Subjects
Browse all chapters by subject