Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2024 Set 1
Questions

Q7

MCQ1 mark, −0.33Algorithms

Given an integer array of size NN, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.