Algorithm GATE CS PYQ 2024 Explained
ฝัง
- เผยแพร่เมื่อ 10 ก.พ. 2025
- 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
(A) both Ο(𝑁) and Ω(𝑁)
(B) Ο(𝑁) but not Ω(𝑁)
(C) Ω(𝑁) but not Ο(𝑁)
(D) neither Ο(𝑁) nor Ω(𝑁)
Algorithm GATE CS PYQ 2024 Explained