GATE CS 2006 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0212

An element in an array X is called a leader if it is grater than all elements to the right of it in X. The best algorithm to find all leaders in an array.
  1. A
    Solves it in linear time using a left to right pass of the array
  2. B
    Solves in linear time using a right to left pass of the array
  3. C
    Solves it is using divide and conquer in time \(\Theta\)(nlogn)
  4. D
    Solves it in time \(\Theta (n^{2})\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/978/gate2006-17

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com