Computer Sciences > Gate 2024 Set-1 > TCP IP
Given an integer array of size N, 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
Explanation
Correct : a
Similar Questions
What is the worst-case time complexity of insertion in an AVL tree?
Which operations on a binary search tree have O(h) complexity?
Compare search complexities of sorted array vs balanced BST.