GATE CS 2026 Set 2 | Question 38

Algorithms › Algorithm Analysis · MCQ · 2 marks · Answer: A

  1. Question 38Algorithmsmcq2 marks
    Consider an array of integers of size . The indices of run from 1 to . An algorithm is to be designed to check whether satisfies the condition given below.
    Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
    • A.
      ✓
    • B.
    • C.
    • D.

    Answer: A

    Solution

    Answer: (A) Let be the consecutive differences. The condition says the sequence is strictly increasing. This can be verified by a single linear scan comparing each with , i.e. in .

More GATE PYQ on Algorithm Analysis

All GATE CS Algorithms PYQ →

Attempt GATE CS 2026 Set 2 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →