Exams › GATE › Technical
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 worst-case number of comparisons by an algorithm that searches for an element in a bitonic array A?
- Θ(n)
- Θ(1)
- Θ(log² n)
- Θ(log n)
Correct answer: Θ(log n)
Solution
The correct option is Θ(log n) because a bitonic array can be efficiently searched using a modified binary search approach. This method allows us to find the peak element in logarithmic time, and then we can perform binary searches on the two sorted halves, resulting in an overall search time of Θ(log n).
Related GATE Technical questions
- Which one of the following options is correct for the given data in the table?
Iteration (i): 0, 1, 2, 3
Input (I): 20, -4, 10, 15
Output (X): 20, 16, 26, 41
Output (Y): 20, -80, -800, -12000
- Consider a binary tree T in which every node has either zero or two children. Let n > 0 be the number of nodes in T. Which ONE of the following is the number of nodes in T that have exactly two children?
- Let L, M, and N be non-singular matrices of order 3 satisfying the equations L² = L⁻¹, M = L⁸ and N = L². Which ONE of the following is the value of the determinant of (M - N)?
- Let P(x) be an arbitrary predicate over the domain of natural numbers. Which ONE of the following statements is TRUE?
- Consider the following statements:
(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address.
(ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.
Which ONE of the following is CORRECT?
- A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X. Which ONE of the following is NOT a possible candidate for X?
⚔️ Practice GATE Technical free + battle 1v1 →