Computer Sciences > GATE 2026 SET-2 > Algorithms
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.
βˆ€π‘–,π‘—βˆˆ{1,…,π‘›βˆ’1} such that 𝑖>𝑗,(𝐴[𝑖+1]βˆ’π΄[𝑖])> (𝐴[𝑗+1]βˆ’π΄[𝑗])
Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?
A
Θ(n)
B
Θ(log n)
C
Θ(n log n)
D
Θ(n²)

Correct : a

Similar Questions

Match the following (P) Prim’s algorithm for minimum spanning tree (i) Backtracking (Q) Floyd-Warshall algorithm fo...
#82 MCQ
Consider the following table Algorithms Design Paradigms (P) Kruskal (i) Divide and Conquer...
#203 MCQ
Consider functions Function 1 and Function 2 expressed in pseudocode as follows: Let f1(n) and f2(n) denote the number of times the statement "x = x + 1" is...
#989 MSQ

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......